From b70903dca0c53810358e1597387419203ccf71d3 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Tue, 16 Oct 2001 11:40:19 +0000 Subject: [PATCH] Added BOOST_HAS_LONG_LONG config option. [SVN r11392] --- include/boost/config/compiler/gcc.hpp | 5 +++++ include/boost/config/suffix.hpp | 9 +++++++++ test/boost_has_long_long.ipp | 28 +++++++++++++++++++++++++++ test/config_test.cpp | 8 +++++++- test/regression.cfg | 2 ++ 5 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 test/boost_has_long_long.ipp diff --git a/include/boost/config/compiler/gcc.hpp b/include/boost/config/compiler/gcc.hpp index 586bd41b..f6ed92f5 100644 --- a/include/boost/config/compiler/gcc.hpp +++ b/include/boost/config/compiler/gcc.hpp @@ -35,6 +35,11 @@ // #define BOOST_HAS_THREADS +// +// long long support: always turn this on here? +// +#define BOOST_HAS_LONG_LONG + #define BOOST_COMPILER "GNU C++ version " BOOST_STRINGIZE(__GNUC__) "." BOOST_STRINGIZE(__GNUC_MINOR__) // diff --git a/include/boost/config/suffix.hpp b/include/boost/config/suffix.hpp index a5a019dd..e036b1e4 100644 --- a/include/boost/config/suffix.hpp +++ b/include/boost/config/suffix.hpp @@ -21,6 +21,15 @@ # define BOOST_DECL // default for compilers not needing this decoration. # endif +// +// look for long long by looking for the appropriate macros in +// +#include +# if !defined(BOOST_MSVC) && !defined(__BORLANDC__) \ + && (defined(ULLONG_MAX) || defined(ULONG_LONG_MAX) || defined(ULONGLONG_MAX)) +# define BOOST_HAS_LONG_LONG +#endif + // // Assume any extensions are in namespace std:: unless stated otherwise: // diff --git a/test/boost_has_long_long.ipp b/test/boost_has_long_long.ipp new file mode 100644 index 00000000..ed85425f --- /dev/null +++ b/test/boost_has_long_long.ipp @@ -0,0 +1,28 @@ +// (C) Copyright John Maddock 2001. Permission to copy, use, modify, sell and +// distribute this software is granted provided this copyright notice appears +// in all copies. This software is provided "as is" without express or implied +// warranty, and with no claim as to its suitability for any purpose. + +// MACRO: BOOST_HAS_LONG_LONG +// TITLE: long long +// DESCRIPTION: The platform supports long long. + +#include + + +namespace boost_has_long_long{ + +int test() +{ + long long int lli = 0LL; + unsigned long long int ulli = 0uLL; + (void)lli; + (void)ulli; + return 0; +} + +} + + + + diff --git a/test/config_test.cpp b/test/config_test.cpp index 69babb5c..0c306c97 100644 --- a/test/config_test.cpp +++ b/test/config_test.cpp @@ -10,7 +10,7 @@ // Do not edit this file, it was generated automatically by // ../tools/generate from boost_*.cxx on -// Thu Oct 11 12:24:39 2001 +// Tue Oct 16 12:34:33 2001 #include #define BOOST_INCLUDE_MAIN @@ -237,6 +237,11 @@ namespace boost_has_gettimeofday = empty_boost; #else namespace boost_has_hash = empty_boost; #endif +#ifdef BOOST_HAS_LONG_LONG +#include "boost_has_long_long.cxx" +#else +namespace boost_has_long_long = empty_boost; +#endif #ifdef BOOST_HAS_MACRO_USE_FACET #include "boost_has_macro_use_facet.cxx" #else @@ -368,6 +373,7 @@ int test_main( int, char *[] ) BOOST_TEST(0 == boost_has_nl_types_h::test()); BOOST_TEST(0 == boost_has_nanosleep::test()); BOOST_TEST(0 == boost_has_macro_use_facet::test()); + BOOST_TEST(0 == boost_has_long_long::test()); BOOST_TEST(0 == boost_has_hash::test()); BOOST_TEST(0 == boost_has_gettimeofday::test()); BOOST_TEST(0 == boost_has_ftime::test()); diff --git a/test/regression.cfg b/test/regression.cfg index a4932337..55be7aaf 100644 --- a/test/regression.cfg +++ b/test/regression.cfg @@ -93,6 +93,8 @@ run libs/config/test/has_gettimeofday_pass.cpp link-fail libs/config/test/has_gettimeofday_fail.cpp run libs/config/test/has_hash_pass.cpp link-fail libs/config/test/has_hash_fail.cpp +run libs/config/test/has_long_long_pass.cpp +link-fail libs/config/test/has_long_long_fail.cpp run libs/config/test/has_macro_use_facet_pass.cpp link-fail libs/config/test/has_macro_use_facet_fail.cpp run libs/config/test/has_nanosleep_pass.cpp