From 14bb18e0d286a98a241caa506b1973f368481a18 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Thu, 27 Jul 2006 12:54:05 +0000 Subject: [PATCH] Get the C++ macros/conditionals right. --- lib/ChangeLog | 7 ++++++- lib/stdint_.h | 4 ++++ m4/ChangeLog | 5 +++++ m4/stdint.m4 | 3 ++- 4 files changed, 17 insertions(+), 2 deletions(-) diff --git a/lib/ChangeLog b/lib/ChangeLog index 2fe0eba62..5f475c5ee 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,9 @@ +2006-07-27 Bruno Haible + + * 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 * 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 * version-etc.c (version_etc_va): Use va_copy, assumed to be defined in diff --git a/lib/stdint_.h b/lib/stdint_.h index adab4d7c2..44eca933c 100644 --- 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 */ diff --git a/m4/ChangeLog b/m4/ChangeLog index 89bc9f480..62cee0ccc 100644 --- a/m4/ChangeLog +++ b/m4/ChangeLog @@ -1,3 +1,8 @@ +2006-07-27 Bruno Haible + + * stdint.m4 (gl_STDINT_H): Define __STDC_CONSTANT_MACROS during the + test. + 2006-07-26 Eric Blake * unistd-safer.m4 (gl_UNISTD_SAFER): Check for missing pipe. diff --git a/m4/stdint.m4 b/m4/stdint.m4 index b58ccdc61..48748c613 100644 --- 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_DEFUN([gl_STDINT_H], AC_LANG_PROGRAM([[ #include #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; -- 2.11.0