changeset 7055:5bea7b615db5

Get the C++ macros/conditionals right.
author Bruno Haible <bruno@clisp.org>
date Thu, 27 Jul 2006 12:54:05 +0000
parents 45e54b67167a
children db9b9e26e735
files lib/ChangeLog lib/stdint_.h m4/ChangeLog m4/stdint.m4
diffstat 4 files changed, 17 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lib/ChangeLog
+++ b/lib/ChangeLog
@@ -1,3 +1,9 @@
+2006-07-27  Bruno Haible  <bruno@clisp.org>
+
+	* stdint_.h (INT*_C, UINT*_C) [C++]: Define these if
+	__STDC_CONSTANT_MACROS is defined, not if __STDC_LIMIT_MACROS is
+	defined.
+
 2006-07-26  Eric Blake  <ebb9@byu.net>
 
 	* mkstemp-safer.c [! HAVE_MKSTEMP]: Add prototype for platforms
@@ -5,7 +11,6 @@
 	* pipe-safer.c (pipe_safer) [!HAVE_FUNC_PIPE]: Provide fallback to
 	avoid compilation warning on mingw.
 
-
 2006-07-25  Bruno Haible  <bruno@clisp.org>
 
 	* version-etc.c (version_etc_va): Use va_copy, assumed to be defined in
--- a/lib/stdint_.h
+++ b/lib/stdint_.h
@@ -394,8 +394,12 @@
 #define WINT_MAX  \
    _STDINT_MAX (@HAVE_SIGNED_WINT_T@, @BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@)
 
+#endif /* !defined __cplusplus || defined __STDC_LIMIT_MACROS */
+
 /* 7.18.4. Macros for integer constants */
 
+#if ! defined __cplusplus || defined __STDC_CONSTANT_MACROS
+
 /* 7.18.4.1. Macros for minimum-width integer constants */
 /* According to ISO C 99 Technical Corrigendum 1 */
 
--- a/m4/ChangeLog
+++ b/m4/ChangeLog
@@ -1,3 +1,8 @@
+2006-07-27  Bruno Haible  <bruno@clisp.org>
+
+	* stdint.m4 (gl_STDINT_H): Define __STDC_CONSTANT_MACROS during the
+	test.
+
 2006-07-26  Eric Blake  <ebb9@byu.net>
 
 	* unistd-safer.m4 (gl_UNISTD_SAFER): Check for missing pipe.
--- a/m4/stdint.m4
+++ b/m4/stdint.m4
@@ -1,4 +1,4 @@
-# stdint.m4 serial 17
+# stdint.m4 serial 18
 dnl Copyright (C) 2001-2002, 2004-2006 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -71,6 +71,7 @@
 	 AC_LANG_PROGRAM([[
 #include <stddef.h>
 #define __STDC_LIMIT_MACROS 1 /* to make it work also in C++ mode */
+#define __STDC_CONSTANT_MACROS 1 /* to make it work also in C++ mode */
 #include ABSOLUTE_STDINT_H
 #ifdef INT8_MAX
 int8_t a1 = INT8_MAX;