1c448f3551
Also no longer let getc()/putc() point to libio functions directly (they were even only macros there, too...). Should now be backwards compatible, too. Thanks to Waldemar for pointing this out! git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8894 a95241bf-73f2-0310-859d-f6bbb57e9c96
28 lines
775 B
C
28 lines
775 B
C
/*
|
|
** Distributed under the terms of the Haiku License.
|
|
*/
|
|
#ifndef _STDIO_POST_H_
|
|
#define _STDIO_POST_H_
|
|
|
|
// "Private"/inline functions of our BeOS compatible stdio implementation
|
|
|
|
// ToDo: this is a work in progress to make our stdio
|
|
// BeOS' GNU/libio (almost) binary compatible
|
|
// We may not yet be compatible!
|
|
|
|
#ifndef _STDIO_H_
|
|
# error "This file must be included from stdio.h!"
|
|
#endif
|
|
|
|
extern char _single_threaded;
|
|
// this boolean value is true (1) if there is only the main thread
|
|
// running - as soon as you spawn the first thread, it's set to
|
|
// false (0)
|
|
|
|
#define getc(stream) \
|
|
(_single_threaded ? getc_unlocked(stream) : getc(stream))
|
|
#define putc(c, stream) \
|
|
(_single_threaded ? putc_unlocked(c, stream) : putc(c, stream))
|
|
|
|
#endif /* _STDIO_POST_H_ */
|