Skip to content

Commit cab772a

Browse files
committed
stdio: Make sure __VALIST is defined in stdio.h
This is needed for the newlib stdio API. Signed-off-by: Keith Packard <keithp@keithp.com>
1 parent 404a12b commit cab772a

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

newlib/libc/stdio/stdio.h

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,14 @@ typedef _fpos64_t fpos64_t;
155155
* Functions defined in ANSI C standard.
156156
*/
157157

158+
#ifndef __VALIST
159+
#ifdef __GNUC__
160+
#define __VALIST __gnuc_va_list
161+
#else
162+
#define __VALIST char*
163+
#endif
164+
#endif
165+
158166
#if __POSIX_VISIBLE
159167
char * ctermid (char *);
160168
#endif
@@ -629,7 +637,7 @@ FILE *_fopencookie_r (struct _reent *, void *__cookie,
629637

630638
#ifndef __CUSTOM_FILE_IO__
631639
/*
632-
* The __sfoo macros are here so that we can
640+
* The __sfoo macros are here so that we can
633641
* define function versions in the C library.
634642
*/
635643
#define __sgetc_raw_r(__ptr, __f) (--(__f)->_r < 0 ? __srget_r(__ptr, __f) : (int)(*(__f)->_p++))
@@ -638,7 +646,7 @@ FILE *_fopencookie_r (struct _reent *, void *__cookie,
638646
/* For a platform with CR/LF, additional logic is required by
639647
__sgetc_r which would otherwise simply be a macro; therefore we
640648
use an inlined function. The function is only meant to be inlined
641-
in place as used and the function body should never be emitted.
649+
in place as used and the function body should never be emitted.
642650
643651
There are two possible means to this end when compiling with GCC,
644652
one when compiling with a standard C99 compiler, and for other

0 commit comments

Comments
 (0)