diff lib/stdio.in.h @ 10433:02b0f65bfbfc

New module 'perror'.
author Bruno Haible <bruno@clisp.org>
date Sun, 14 Sep 2008 13:50:55 +0200 (2008-09-14)
parents f96e845fc36d
children 953f72c1ffcc
line wrap: on
line diff
--- a/lib/stdio.in.h
+++ b/lib/stdio.in.h
@@ -395,6 +395,22 @@
    getline (l, s, f))
 #endif
 
+#if @GNULIB_PERROR@
+# if @REPLACE_PERROR@
+#  define perror rpl_perror
+/* Print a message to standard error, describing the value of ERRNO,
+   (if STRING is not NULL and not empty) prefixed with STRING and ": ",
+   and terminated with a newline.  */
+extern void perror (const char *string);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef perror
+# define perror(s) \
+    (GL_LINK_WARNING ("perror is not always POSIX compliant - " \
+                      "use gnulib module perror for portability"), \
+     perror (s))
+#endif
+
 #ifdef __cplusplus
 }
 #endif