xref: /haiku/headers/posix/stdio_post.h (revision 24159a0c7d6d6dcba9f2a0c1a7c08d2c8167f21b)
1 /*
2 ** Distributed under the terms of the Haiku License.
3 */
4 #ifndef _STDIO_POST_H_
5 #define _STDIO_POST_H_
6 
7 // "Private"/inline functions of our BeOS compatible stdio implementation
8 
9 // ToDo: this is a work in progress to make our stdio
10 //		BeOS' GNU/libio (almost) binary compatible
11 //		We may not yet be compatible!
12 
13 #ifndef _STDIO_H_
14 #	error "This file must be included from stdio.h!"
15 #endif
16 
17 extern char _single_threaded;
18 	// this boolean value is true (1) if there is only the main thread
19 	// running - as soon as you spawn the first thread, it's set to
20 	// false (0)
21 
22 #define getc(stream) \
23 	(_single_threaded ? getc_unlocked(stream) : getc(stream))
24 #define putc(c, stream) \
25 	(_single_threaded ? putc_unlocked(c, stream) : putc(c, stream))
26 
27 #endif	/* _STDIO_POST_H_ */
28