2003-02-11 22:37:58 +03:00
|
|
|
/*
|
2004-09-08 20:22:28 +04:00
|
|
|
** Distributed under the terms of the Haiku License.
|
2003-02-11 22:37:58 +03:00
|
|
|
*/
|
2004-05-03 13:29:27 +04:00
|
|
|
#ifndef _STDIO_POST_H_
|
|
|
|
#define _STDIO_POST_H_
|
2003-02-11 22:37:58 +03:00
|
|
|
|
2008-05-11 01:30:34 +04:00
|
|
|
/* "Private"/inline functions of our BeOS compatible stdio implementation */
|
2003-02-11 22:37:58 +03:00
|
|
|
|
2008-05-11 01:30:34 +04:00
|
|
|
/* ToDo: this is a work in progress to make our stdio
|
|
|
|
* BeOS' GNU/libio (almost) binary compatible
|
|
|
|
* We may not yet be compatible! */
|
2003-02-11 22:37:58 +03:00
|
|
|
|
|
|
|
#ifndef _STDIO_H_
|
|
|
|
# error "This file must be included from stdio.h!"
|
|
|
|
#endif
|
|
|
|
|
2008-03-25 04:56:46 +03:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2004-05-03 13:29:27 +04:00
|
|
|
extern char _single_threaded;
|
2008-05-11 01:30:34 +04:00
|
|
|
/* 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) */
|
2004-05-03 13:29:27 +04:00
|
|
|
|
2008-03-25 04:56:46 +03:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2003-02-11 22:37:58 +03:00
|
|
|
#define getc(stream) \
|
2004-09-08 20:22:28 +04:00
|
|
|
(_single_threaded ? getc_unlocked(stream) : getc(stream))
|
2003-02-11 22:37:58 +03:00
|
|
|
#define putc(c, stream) \
|
2004-09-08 20:22:28 +04:00
|
|
|
(_single_threaded ? putc_unlocked(c, stream) : putc(c, stream))
|
2003-02-11 22:37:58 +03:00
|
|
|
|
|
|
|
#endif /* _STDIO_POST_H_ */
|