diff options
author | Mattias Andrée <maandree@operamail.com> | 2015-10-08 01:40:36 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2015-10-08 01:40:36 +0200 |
commit | fb9454705c02bdd638e6f7207c5622dce8af02a0 (patch) | |
tree | 9130e8572d7393214dc5f088857ef36a021b92e2 | |
parent | m slibc_perror (diff) | |
download | slibc-fb9454705c02bdd638e6f7207c5622dce8af02a0.tar.gz slibc-fb9454705c02bdd638e6f7207c5622dce8af02a0.tar.bz2 slibc-fb9454705c02bdd638e6f7207c5622dce8af02a0.tar.xz |
on some systems, va_start and va_end contains { and }, respetively, therefore, if _PORTABLE_SOURCE or _LIBRARY_HEADER is defined, they should here too
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r-- | README | 3 | ||||
-rw-r--r-- | include/stdarg.h | 12 |
2 files changed, 12 insertions, 3 deletions
@@ -16,7 +16,8 @@ Macro definitions: _BSD_SOURCE -- Enable BSD extensions. _SLIBC_SUPPRESS_WARNINGS -- Suppress all #warning and other warnings, this is primarily intended to be used when compiling slibc. - _PORTABLE_SOURCE -- Unconditionally disable all extensions. + _PORTABLE_SOURCE -- Unconditionally disable all extensions, and otherwise + help ensure that the source is portable. _LIBRARY_HEADER -- Alternative to _PORTABLE_SOURCE that should be used in header files for libraryes. This allows you to be sure that your library is diff --git a/include/stdarg.h b/include/stdarg.h index 801e5e8..bc07813 100644 --- a/include/stdarg.h +++ b/include/stdarg.h @@ -52,7 +52,11 @@ typedef __builtin_va_list va_list; * @param last:identifier The the last non-variadic argument. */ #ifndef va_start -# define va_start(state, last) __builtin_va_start(state, last) +# ifndef __PORTABLE +# define va_start(state, last) __builtin_va_start(state, last) +# else +# define va_start(state, last) { __builtin_va_start(state, last) +# endif #endif /** @@ -61,7 +65,11 @@ typedef __builtin_va_list va_list; * @param state:va_list The state of the variadic argument-reading. */ #ifndef va_end -# define va_end(state) __builtin_va_end(state) +# ifndef __PORTABLE +# define va_end(state) __builtin_va_end(state) +# else +# define va_end(state) } __builtin_va_end(state) +# endif #endif /** |