X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fstdio.in.h;h=135b08485bef8bb0f3aea6ea8d0048f671d6970b;hb=55898ee1c7c12e63772c65e772577f10bb7adb31;hp=58eb4f0b2aac131cb2f148eff76868f1094e5410;hpb=1dea0e3d91da0ab9bb3f2173a5364f42d81d7eeb;p=gnulib.git diff --git a/lib/stdio.in.h b/lib/stdio.in.h index 58eb4f0b2..135b08485 100644 --- a/lib/stdio.in.h +++ b/lib/stdio.in.h @@ -63,6 +63,10 @@ /* The definition of _GL_WARN_ON_USE is copied here. */ +/* Macros for stringification. */ +#define _GL_STDIO_STRINGIZE(token) #token +#define _GL_STDIO_MACROEXPAND_AND_STRINGIZE(token) _GL_STDIO_STRINGIZE(token) + #if @GNULIB_DPRINTF@ # if @REPLACE_DPRINTF@ @@ -533,7 +537,9 @@ _GL_FUNCDECL_SYS (getline, ssize_t, _GL_CXXALIAS_SYS (getline, ssize_t, (char **lineptr, size_t *linesize, FILE *stream)); # endif +# if @HAVE_DECL_GETLINE@ _GL_CXXALIASWARN (getline); +# endif #elif defined GNULIB_POSIXCHECK # undef getline # if HAVE_RAW_DECL_GETLINE @@ -638,16 +644,26 @@ _GL_WARN_ON_USE (popen, "popen is buggy on some platforms - " #if @GNULIB_PRINTF_POSIX@ || @GNULIB_PRINTF@ # if (@GNULIB_PRINTF_POSIX@ && @REPLACE_PRINTF@) \ || (@GNULIB_PRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@) -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# if defined __GNUC__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) /* Don't break __attribute__((format(printf,M,N))). */ -# define printf __printf__ -# endif -# define GNULIB_overrides_printf 1 +# define printf __printf__ +# endif _GL_FUNCDECL_RPL_1 (__printf__, int, (const char *format, ...) + __asm__ (@ASM_SYMBOL_PREFIX@ + _GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_printf)) __attribute__ ((__format__ (__printf__, 1, 2))) _GL_ARG_NONNULL ((1))); _GL_CXXALIAS_RPL_1 (printf, __printf__, int, (const char *format, ...)); +# else +_GL_FUNCDECL_RPL (printf, int, + (const char *format, ...) + __attribute__ ((__format__ (__printf__, 1, 2))) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (printf, int, (const char *format, ...)); +# endif +# define GNULIB_overrides_printf 1 # else _GL_CXXALIAS_SYS (printf, int, (const char *format, ...)); # endif @@ -836,6 +852,25 @@ _GL_WARN_ON_USE (sprintf, "sprintf is not always POSIX compliant - " "POSIX compliance"); #endif +#if @GNULIB_TMPFILE@ +# if @REPLACE_TMPFILE@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define tmpfile rpl_tmpfile +# endif +_GL_FUNCDECL_RPL (tmpfile, FILE *, (void)); +_GL_CXXALIAS_RPL (tmpfile, FILE *, (void)); +# else +_GL_CXXALIAS_SYS (tmpfile, FILE *, (void)); +# endif +_GL_CXXALIASWARN (tmpfile); +#elif defined GNULIB_POSIXCHECK +# undef tmpfile +# if HAVE_RAW_DECL_TMPFILE +_GL_WARN_ON_USE (tmpfile, "tmpfile is not usable on mingw - " + "use gnulib module tmpfile for portability"); +# endif +#endif + #if @GNULIB_VASPRINTF@ /* Write formatted output to a string dynamically allocated with malloc(). If the memory allocation succeeds, store the address of the string in @@ -900,7 +935,10 @@ _GL_FUNCDECL_SYS (vdprintf, int, (int fd, const char *format, va_list args) __attribute__ ((__format__ (__printf__, 2, 0))) _GL_ARG_NONNULL ((2))); # endif -_GL_CXXALIAS_SYS (vdprintf, int, (int fd, const char *format, va_list args)); +/* Need to cast, because on Solaris, the third parameter will likely be + __va_list args. */ +_GL_CXXALIAS_SYS_CAST (vdprintf, int, + (int fd, const char *format, va_list args)); # endif _GL_CXXALIASWARN (vdprintf); #elif defined GNULIB_POSIXCHECK @@ -923,7 +961,11 @@ _GL_FUNCDECL_RPL (vfprintf, int, (FILE *fp, const char *format, va_list args) _GL_ARG_NONNULL ((1, 2))); _GL_CXXALIAS_RPL (vfprintf, int, (FILE *fp, const char *format, va_list args)); # else -_GL_CXXALIAS_SYS (vfprintf, int, (FILE *fp, const char *format, va_list args)); +/* Need to cast, because on Solaris, the third parameter is + __va_list args + and GCC's fixincludes did not change this to __gnuc_va_list. */ +_GL_CXXALIAS_SYS_CAST (vfprintf, int, + (FILE *fp, const char *format, va_list args)); # endif _GL_CXXALIASWARN (vfprintf); #endif @@ -949,7 +991,10 @@ _GL_FUNCDECL_RPL (vprintf, int, (const char *format, va_list args) _GL_ARG_NONNULL ((1))); _GL_CXXALIAS_RPL (vprintf, int, (const char *format, va_list args)); # else -_GL_CXXALIAS_SYS (vprintf, int, (const char *format, va_list args)); +/* Need to cast, because on Solaris, the second parameter is + __va_list args + and GCC's fixincludes did not change this to __gnuc_va_list. */ +_GL_CXXALIAS_SYS_CAST (vprintf, int, (const char *format, va_list args)); # endif _GL_CXXALIASWARN (vprintf); #endif @@ -1005,8 +1050,11 @@ _GL_FUNCDECL_RPL (vsprintf, int, _GL_CXXALIAS_RPL (vsprintf, int, (char *str, const char *format, va_list args)); # else -_GL_CXXALIAS_SYS (vsprintf, int, - (char *str, const char *format, va_list args)); +/* Need to cast, because on Solaris, the third parameter is + __va_list args + and GCC's fixincludes did not change this to __gnuc_va_list. */ +_GL_CXXALIAS_SYS_CAST (vsprintf, int, + (char *str, const char *format, va_list args)); # endif _GL_CXXALIASWARN (vsprintf); #elif defined GNULIB_POSIXCHECK