newlib: update

git-svn-id: svn://kolibrios.org@6099 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Sergey Semyonov (Serge)
2016-01-26 02:29:46 +00:00
parent 38392b6ca6
commit cabcfc4bb3
144 changed files with 6873 additions and 1545 deletions

View File

@@ -38,7 +38,7 @@
case _STDIO_CLOSE_PER_REENT_STD_STREAMS is defined these file descriptors
will be closed via close() provided the owner of the reent structure
triggerd the on demand reent initilization, see CHECK_INIT(). */
#ifndef __rtems__
#if !defined(__rtems__) && !defined(__tirtos__)
#define _STDIO_CLOSE_PER_REENT_STD_STREAMS
#endif
@@ -60,7 +60,16 @@
#define _STDIO_WITH_THREAD_CANCELLATION_SUPPORT
#endif
#ifdef _STDIO_WITH_THREAD_CANCELLATION_SUPPORT
#if defined(__SINGLE_THREAD__) || defined(__IMPL_UNLOCKED__)
# define _newlib_flockfile_start(_fp)
# define _newlib_flockfile_exit(_fp)
# define _newlib_flockfile_end(_fp)
# define _newlib_sfp_lock_start()
# define _newlib_sfp_lock_exit()
# define _newlib_sfp_lock_end()
#elif defined(_STDIO_WITH_THREAD_CANCELLATION_SUPPORT)
#include <pthread.h>
/* Start a stream oriented critical section: */
@@ -68,16 +77,19 @@
{ \
int __oldfpcancel; \
pthread_setcancelstate (PTHREAD_CANCEL_DISABLE, &__oldfpcancel); \
_flockfile (_fp)
if (!(_fp->_flags2 & __SNLK)) \
_flockfile (_fp)
/* Exit from a stream oriented critical section prematurely: */
# define _newlib_flockfile_exit(_fp) \
_funlockfile (_fp); \
if (!(_fp->_flags2 & __SNLK)) \
_funlockfile (_fp); \
pthread_setcancelstate (__oldfpcancel, &__oldfpcancel);
/* End a stream oriented critical section: */
# define _newlib_flockfile_end(_fp) \
_funlockfile (_fp); \
if (!(_fp->_flags2 & __SNLK)) \
_funlockfile (_fp); \
pthread_setcancelstate (__oldfpcancel, &__oldfpcancel); \
}
@@ -99,17 +111,20 @@
pthread_setcancelstate (__oldsfpcancel, &__oldsfpcancel); \
}
#else /* !_STDIO_WITH_THREAD_CANCELLATION_SUPPORT */
#else /* !__SINGLE_THREAD__ && !__IMPL_UNLOCKED__ && !_STDIO_WITH_THREAD_CANCELLATION_SUPPORT */
# define _newlib_flockfile_start(_fp) \
{ \
_flockfile(_fp)
if (!(_fp->_flags2 & __SNLK)) \
_flockfile (_fp)
# define _newlib_flockfile_exit(_fp) \
_funlockfile(_fp); \
if (!(_fp->_flags2 & __SNLK)) \
_funlockfile(_fp); \
# define _newlib_flockfile_end(_fp) \
_funlockfile(_fp); \
if (!(_fp->_flags2 & __SNLK)) \
_funlockfile(_fp); \
}
# define _newlib_sfp_lock_start() \
@@ -123,8 +138,10 @@
__sfp_lock_release (); \
}
#endif /* _STDIO_WITH_THREAD_CANCELLATION_SUPPORT */
#endif /* __SINGLE_THREAD__ || __IMPL_UNLOCKED__ */
extern wint_t _EXFUN(__fgetwc, (struct _reent *, FILE *));
extern wint_t _EXFUN(__fputwc, (struct _reent *, wchar_t, FILE *));
extern u_char *_EXFUN(__sccl, (char *, u_char *fmt));
extern int _EXFUN(__svfscanf_r,(struct _reent *,FILE *, _CONST char *,va_list));
extern int _EXFUN(__ssvfscanf_r,(struct _reent *,FILE *, _CONST char *,va_list));
@@ -134,19 +151,22 @@ extern int _EXFUN(__svfwscanf_r,(struct _reent *,FILE *, _CONST wchar_t *,va_
extern int _EXFUN(__ssvfwscanf_r,(struct _reent *,FILE *, _CONST wchar_t *,va_list));
extern int _EXFUN(__svfiwscanf_r,(struct _reent *,FILE *, _CONST wchar_t *,va_list));
extern int _EXFUN(__ssvfiwscanf_r,(struct _reent *,FILE *, _CONST wchar_t *,va_list));
int _EXFUN(_svfprintf_r,(struct _reent *, FILE *, const char *,
int _EXFUN(_svfprintf_r,(struct _reent *, FILE *, const char *,
va_list)
_ATTRIBUTE ((__format__ (__printf__, 3, 0))));
int _EXFUN(_svfiprintf_r,(struct _reent *, FILE *, const char *,
int _EXFUN(_svfiprintf_r,(struct _reent *, FILE *, const char *,
va_list)
_ATTRIBUTE ((__format__ (__printf__, 3, 0))));
int _EXFUN(_svfwprintf_r,(struct _reent *, FILE *, const wchar_t *,
int _EXFUN(_svfwprintf_r,(struct _reent *, FILE *, const wchar_t *,
va_list));
int _EXFUN(_svfiwprintf_r,(struct _reent *, FILE *, const wchar_t *,
int _EXFUN(_svfiwprintf_r,(struct _reent *, FILE *, const wchar_t *,
va_list));
extern FILE *_EXFUN(__sfp,(struct _reent *));
extern int _EXFUN(__sflags,(struct _reent *,_CONST char*, int*));
extern int _EXFUN(__sflush_r,(struct _reent *,FILE *));
#ifdef _STDIO_BSD_SEMANTICS
extern int _EXFUN(__sflushw_r,(struct _reent *,FILE *));
#endif
extern int _EXFUN(__srefill_r,(struct _reent *,FILE *));
extern _READ_WRITE_RETURN_TYPE _EXFUN(__sread,(struct _reent *, void *, char *,
_READ_WRITE_BUFSIZE_TYPE));
@@ -178,37 +198,37 @@ extern _READ_WRITE_RETURN_TYPE _EXFUN(__swrite64,(struct _reent *, void *,
#ifdef _REENT_SMALL
#define CHECK_INIT(ptr, fp) \
do \
{ \
do \
{ \
struct _reent *_check_init_ptr = (ptr); \
if ((_check_init_ptr) && !(_check_init_ptr)->__sdidinit) \
__sinit (_check_init_ptr); \
if ((fp) == (FILE *)&__sf_fake_stdin) \
if ((fp) == (FILE *)&__sf_fake_stdin) \
(fp) = _stdin_r(_check_init_ptr); \
else if ((fp) == (FILE *)&__sf_fake_stdout) \
else if ((fp) == (FILE *)&__sf_fake_stdout) \
(fp) = _stdout_r(_check_init_ptr); \
else if ((fp) == (FILE *)&__sf_fake_stderr) \
else if ((fp) == (FILE *)&__sf_fake_stderr) \
(fp) = _stderr_r(_check_init_ptr); \
} \
} \
while (0)
#else /* !_REENT_SMALL */
#define CHECK_INIT(ptr, fp) \
do \
{ \
do \
{ \
struct _reent *_check_init_ptr = (ptr); \
if ((_check_init_ptr) && !(_check_init_ptr)->__sdidinit) \
__sinit (_check_init_ptr); \
} \
} \
while (0)
#endif /* !_REENT_SMALL */
#define CHECK_STD_INIT(ptr) \
do \
{ \
do \
{ \
struct _reent *_check_init_ptr = (ptr); \
if ((_check_init_ptr) && !(_check_init_ptr)->__sdidinit) \
__sinit (_check_init_ptr); \
} \
} \
while (0)
/* Return true and set errno and stream error flag iff the given FILE