diff --git a/cstdint_test.cpp b/cstdint_test.cpp index 7bfa95e..4434ade 100644 --- a/cstdint_test.cpp +++ b/cstdint_test.cpp @@ -9,21 +9,12 @@ // See http://www.boost.org for most recent version including documentation. // Revision History +// 11 Sep 01 Adapted to work with macros defined in native stdint.h (John Maddock) // 12 Nov 00 Adapted to merged // 23 Sep 00 Added INTXX_C constant macro support + int64_t support (John Maddock). // 28 Jun 00 Initial version #include #include -#include -// -// macros should not be defined by default: -// -#ifdef INT8_C -#error header incorrectly implemented -#endif -// -// now define the macros: -// #define __STDC_CONSTANT_MACROS #include @@ -216,12 +207,4 @@ int main() return 0; } -// -// now verify that constant macros get undef'ed correctly: -// -#undef __STDC_CONSTANT_MACROS -#include -#ifdef INT8_C -#error boost/cstdint.hpp not correctly defined -#endif diff --git a/include/boost/cstdint.hpp b/include/boost/cstdint.hpp index 8e2aaa3..2fdc9c9 100644 --- a/include/boost/cstdint.hpp +++ b/include/boost/cstdint.hpp @@ -24,7 +24,7 @@ #include -#ifdef BOOST_SYSTEM_HAS_STDINT_H +#ifdef BOOST_HAS_STDINT_H // The following #include is an implementation artifact; not part of interface. # ifdef __hpux @@ -79,7 +79,7 @@ namespace boost } // namespace boost -#else // BOOST_SYSTEM_HAS_STDINT_H +#else // BOOST_HAS_STDINT_H # include // implementation artifact; not part of interface @@ -195,7 +195,7 @@ namespace boost } // namespace boost -#endif // BOOST_SYSTEM_HAS_STDINT_H +#endif // BOOST_HAS_STDINT_H #endif // BOOST_CSTDINT_HPP @@ -210,11 +210,13 @@ __STDC_CONSTANT_MACROS is defined. Undefine the macros if __STDC_CONSTANT_MACROS is not defined and the macros are (cf ). -Added 23rd September (John Maddock). +Added 23rd September 2000 (John Maddock). +Modified 11th September 2001 to be excluded when +BOOST_HAS_STDINT_H is defined (John Maddock). ******************************************************/ -#if defined(__STDC_CONSTANT_MACROS) && !defined(BOOST__STDC_CONSTANT_MACROS_DEFINED) +#if defined(__STDC_CONSTANT_MACROS) && !defined(BOOST__STDC_CONSTANT_MACROS_DEFINED) && !defined(BOOST_HAS_STDINT_H) # define BOOST__STDC_CONSTANT_MACROS_DEFINED # if (defined(BOOST_MSVC) && (BOOST_MSVC >= 1100)) || (defined(__BORLANDC__) && (__BORLANDC__ >= 0x520)) // @@ -296,7 +298,7 @@ Added 23rd September (John Maddock). # endif // Borland/Microsoft specific width suffixes -#elif defined(BOOST__STDC_CONSTANT_MACROS_DEFINED) && !defined(__STDC_CONSTANT_MACROS) +#elif defined(BOOST__STDC_CONSTANT_MACROS_DEFINED) && !defined(__STDC_CONSTANT_MACROS) && !defined(BOOST_HAS_STDINT_H) // // undef all the macros: // diff --git a/include/boost/stdint.h b/include/boost/stdint.h index a2a69d2..c5365f6 100644 --- a/include/boost/stdint.h +++ b/include/boost/stdint.h @@ -14,11 +14,11 @@ // NOTE OF OBSOLESCENCE: In general, this header file cannot detect // whether the current translation unit somewhere includes ISO C99 -// or not. For example, in case BOOST_SYSTEM_HAS_STDINT_H +// or not. For example, in case BOOST_HAS_STDINT_H // is not defined and ISO C99 has been included before, // this file will re-define ISO C99 reserved file-scope identifiers // such as int8_t (see ISO C99 7.1.3 and 7.18). Defining the macro -// BOOST_SYSTEM_HAS_STDINT_H is not sufficient in general, in +// BOOST_HAS_STDINT_H is not sufficient in general, in // particular if a partly conformant header is available // on the platform, e.g. Comeau C++ with GNU glibc 2.1.2. // @@ -40,7 +40,7 @@ #include -#ifdef BOOST_SYSTEM_HAS_STDINT_H +#ifdef BOOST_HAS_STDINT_H #include #else @@ -150,7 +150,7 @@ typedef uint32_t uintmax_t; # endif -#endif // BOOST_SYSTEM_HAS_STDINT_H not defined +#endif // BOOST_HAS_STDINT_H not defined #endif // BOOST_STDINT_H /**************************************************** @@ -167,7 +167,7 @@ Added 23rd September (John Maddock). ******************************************************/ -#if defined(__STDC_CONSTANT_MACROS) && !defined(BOOST__STDC_CONSTANT_MACROS_DEFINED) +#if defined(__STDC_CONSTANT_MACROS) && !defined(BOOST__STDC_CONSTANT_MACROS_DEFINED) && !defined(BOOST_HAS_STDINT_H) #define BOOST__STDC_CONSTANT_MACROS_DEFINED #if (defined(BOOST_MSVC) && (BOOST_MSVC >= 1100)) || (defined(__BORLANDC__) && (__BORLANDC__ >= 0x520)) // @@ -252,7 +252,7 @@ Added 23rd September (John Maddock). #endif // Borland/MS specific -#elif defined(BOOST__STDC_CONSTANT_MACROS_DEFINED) && !defined(__STDC_CONSTANT_MACROS) +#elif defined(BOOST__STDC_CONSTANT_MACROS_DEFINED) && !defined(__STDC_CONSTANT_MACROS) && !defined(BOOST_HAS_STDINT_H) // // undef all the macros: //