diff options
Diffstat (limited to 'newlib/libc')
-rw-r--r-- | newlib/libc/include/sys/reent.h | 15 | ||||
-rw-r--r-- | newlib/libc/stdio/dprintf.c | 1 | ||||
-rw-r--r-- | newlib/libc/stdio/vdiprintf.c | 1 | ||||
-rw-r--r-- | newlib/libc/stdio/vdprintf.c | 1 |
4 files changed, 16 insertions, 2 deletions
diff --git a/newlib/libc/include/sys/reent.h b/newlib/libc/include/sys/reent.h index 39785d77d..37fad56c1 100644 --- a/newlib/libc/include/sys/reent.h +++ b/newlib/libc/include/sys/reent.h @@ -149,8 +149,19 @@ struct __sFILE_fake { struct _reent *_data; }; -/* CHECK_STD_INIT() comes from stdio/local.h; be sure to include that. */ -# define _REENT_SMALL_CHECK_INIT(ptr) CHECK_STD_INIT(ptr) + +/* Following is needed both in libc/stdio and libc/stdlib so we put it + * here instead of libc/stdio/local.h where it was previously. */ + +extern _VOID _EXFUN(__sinit,(struct _reent *)); + +# define _REENT_SMALL_CHECK_INIT(ptr) \ + do \ + { \ + if ((ptr) && !(ptr)->__sdidinit) \ + __sinit (ptr); \ + } \ + while (0) #else # define _REENT_SMALL_CHECK_INIT(ptr) /* nothing */ #endif diff --git a/newlib/libc/stdio/dprintf.c b/newlib/libc/stdio/dprintf.c index 53bb50bfa..b0eb19192 100644 --- a/newlib/libc/stdio/dprintf.c +++ b/newlib/libc/stdio/dprintf.c @@ -45,6 +45,7 @@ Supporting OS subroutines required: <<sbrk>>, <<write>>. #include <stdio.h> #include <unistd.h> #include <stdarg.h> +#include "local.h" int _DEFUN(_dprintf_r, (ptr, fd, format), diff --git a/newlib/libc/stdio/vdiprintf.c b/newlib/libc/stdio/vdiprintf.c index b9b94735c..51bdb000e 100644 --- a/newlib/libc/stdio/vdiprintf.c +++ b/newlib/libc/stdio/vdiprintf.c @@ -10,6 +10,7 @@ #include <stdlib.h> #include <unistd.h> #include <stdarg.h> +#include "local.h" int _DEFUN(_vdiprintf_r, (ptr, fd, format, ap), diff --git a/newlib/libc/stdio/vdprintf.c b/newlib/libc/stdio/vdprintf.c index 8a20235ef..bfb19c95b 100644 --- a/newlib/libc/stdio/vdprintf.c +++ b/newlib/libc/stdio/vdprintf.c @@ -10,6 +10,7 @@ #include <stdlib.h> #include <unistd.h> #include <stdarg.h> +#include "local.h" int _DEFUN(_vdprintf_r, (ptr, fd, format, ap), |