[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[6295] gnulib
From: |
karl |
Subject: |
[6295] gnulib |
Date: |
Sun, 31 May 2015 21:31:37 +0000 |
Revision: 6295
http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=6295
Author: karl
Date: 2015-05-31 21:31:35 +0000 (Sun, 31 May 2015)
Log Message:
-----------
gnulib
Modified Paths:
--------------
trunk/gnulib/lib/error.h
trunk/gnulib/lib/string.in.h
trunk/gnulib/m4/stdio_h.m4
Modified: trunk/gnulib/lib/error.h
===================================================================
--- trunk/gnulib/lib/error.h 2015-05-31 21:23:33 UTC (rev 6294)
+++ trunk/gnulib/lib/error.h 2015-05-31 21:31:35 UTC (rev 6295)
@@ -31,6 +31,16 @@
# define _GL_ATTRIBUTE_FORMAT(spec) /* empty */
#endif
+/* On mingw, the flavor of printf depends on whether the extensions module
+ * is in use; the check for <stdio.h> determines the witness macro. */
+#ifndef _GL_ATTRIBUTE_SPEC_PRINTF
+# if GNULIB_PRINTF_ATTRIBUTE_FLAVOR_GNU
+# define _GL_ATTRIBUTE_SPEC_PRINTF __gnu_printf__
+# else
+# define _GL_ATTRIBUTE_SPEC_PRINTF __printf__
+# endif
+#endif
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -40,11 +50,11 @@
If STATUS is nonzero, terminate the program with 'exit (STATUS)'. */
extern void error (int __status, int __errnum, const char *__format, ...)
- _GL_ATTRIBUTE_FORMAT ((__printf__, 3, 4));
+ _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF, 3, 4));
extern void error_at_line (int __status, int __errnum, const char *__fname,
unsigned int __lineno, const char *__format, ...)
- _GL_ATTRIBUTE_FORMAT ((__printf__, 5, 6));
+ _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF, 5, 6));
/* If NULL, error will flush stdout, then print on stderr the program
name, a colon and a space. Otherwise, error will call this
Modified: trunk/gnulib/lib/string.in.h
===================================================================
--- trunk/gnulib/lib/string.in.h 2015-05-31 21:23:33 UTC (rev 6294)
+++ trunk/gnulib/lib/string.in.h 2015-05-31 21:31:35 UTC (rev 6295)
@@ -15,16 +15,32 @@
You should have received a copy of the GNU General Public License
along with this program; if not, see <http://www.gnu.org/licenses/>. */
-#ifndef address@hidden@_STRING_H
-
#if __GNUC__ >= 3
@PRAGMA_SYSTEM_HEADER@
#endif
@PRAGMA_COLUMNS@
+#if defined _GL_ALREADY_INCLUDING_STRING_H
+/* Special invocation convention:
+ - On OS X/NetBSD we have a sequence of nested includes
+ <string.h> -> <strings.h> -> "string.h"
+ In this situation system _chk variants due to -D_FORTIFY_SOURCE
+ might be used after any replacements defined here. */
+
address@hidden@ @NEXT_STRING_H@
+
+#else
+/* Normal invocation convention. */
+
+#ifndef address@hidden@_STRING_H
+
+#define _GL_ALREADY_INCLUDING_STRING_H
+
/* The include_next requires a split double-inclusion guard. */
address@hidden@ @NEXT_STRING_H@
+#undef _GL_ALREADY_INCLUDING_STRING_H
+
#ifndef address@hidden@_STRING_H
#define address@hidden@_STRING_H
@@ -1027,3 +1043,4 @@
#endif /* address@hidden@_STRING_H */
#endif /* address@hidden@_STRING_H */
+#endif
Modified: trunk/gnulib/m4/stdio_h.m4
===================================================================
--- trunk/gnulib/m4/stdio_h.m4 2015-05-31 21:23:33 UTC (rev 6294)
+++ trunk/gnulib/m4/stdio_h.m4 2015-05-31 21:31:35 UTC (rev 6295)
@@ -1,4 +1,4 @@
-# stdio_h.m4 serial 44
+# stdio_h.m4 serial 46
dnl Copyright (C) 2007-2015 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -15,15 +15,21 @@
dnl Determine whether __USE_MINGW_ANSI_STDIO makes printf and
dnl inttypes.h behave like gnu instead of system; we must give our
dnl printf wrapper the right attribute to match.
- AC_CACHE_CHECK([whether inttypes macros match system or gnu printf],
+ AC_CACHE_CHECK([which flavor of printf attribute matches inttypes macros],
[gl_cv_func_printf_attribute_flavor],
- [AC_EGREP_CPP([findme .(ll|j)d. findme],
- [#define __STDC_FORMAT_MACROS 1
+ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+ #define __STDC_FORMAT_MACROS 1
#include <stdio.h>
#include <inttypes.h>
- findme PRIdMAX findme
- ], [gl_cv_func_printf_attribute_flavor=gnu],
- [gl_cv_func_printf_attribute_flavor=system])])
+ /* For non-mingw systems, compilation will trivially succeed.
+ For mingw, compilation will succeed for older mingw (system
+ printf, "I64d") and fail for newer mingw (gnu printf, "lld"). */
+ #if ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) && \
+ (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
+ extern char PRIdMAX_probe[sizeof PRIdMAX == sizeof "I64d" ? 1 : -1];
+ #endif
+ ]])], [gl_cv_func_printf_attribute_flavor=system],
+ [gl_cv_func_printf_attribute_flavor=gnu])])
if test "$gl_cv_func_printf_attribute_flavor" = gnu; then
AC_DEFINE([GNULIB_PRINTF_ATTRIBUTE_FLAVOR_GNU], [1],
[Define to 1 if printf and friends should be labeled with
[Prev in Thread] |
Current Thread |
[Next in Thread] |