689cf874b2
Newlib 2.2.0 w/ nan ofeatures, xtensa patches, locking implementation. Built from https://github.com/projectgus/newlib-xtensa branch xtensa-2_2_0-lock commit daa6ae40cdc8099f54c3e68a586fc1b906169c5a For more details, see: https://github.com/SuperHouse/esp-open-rtos/wiki/libc-configuration Closes #1
27 lines
807 B
C
27 lines
807 B
C
#ifndef _NEWLIB_STDIO_H
|
|
#define _NEWLIB_STDIO_H
|
|
|
|
#include <sys/lock.h>
|
|
#include <sys/reent.h>
|
|
|
|
/* Internal locking macros, used to protect stdio functions. In the
|
|
general case, expand to nothing. Use __SSTR flag in FILE _flags to
|
|
detect if FILE is private to sprintf/sscanf class of functions; if
|
|
set then do nothing as lock is not initialised. */
|
|
#if !defined(_flockfile)
|
|
#ifndef __SINGLE_THREAD__
|
|
# define _flockfile(fp) (((fp)->_flags & __SSTR) ? 0 : __lock_acquire_recursive((fp)->_lock))
|
|
#else
|
|
# define _flockfile(fp) (_CAST_VOID 0)
|
|
#endif
|
|
#endif
|
|
|
|
#if !defined(_funlockfile)
|
|
#ifndef __SINGLE_THREAD__
|
|
# define _funlockfile(fp) (((fp)->_flags & __SSTR) ? 0 : __lock_release_recursive((fp)->_lock))
|
|
#else
|
|
# define _funlockfile(fp) (_CAST_VOID 0)
|
|
#endif
|
|
#endif
|
|
|
|
#endif /* _NEWLIB_STDIO_H */
|