forked from boostorg/config
Make Boost.Config C language compatible.
[SVN r70953]
This commit is contained in:
@ -36,7 +36,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// if we don't have a std library config set, try and find one:
|
// if we don't have a std library config set, try and find one:
|
||||||
#if !defined(BOOST_STDLIB_CONFIG) && !defined(BOOST_NO_STDLIB_CONFIG) && !defined(BOOST_NO_CONFIG)
|
#if !defined(BOOST_STDLIB_CONFIG) && !defined(BOOST_NO_STDLIB_CONFIG) && !defined(BOOST_NO_CONFIG) && defined(__cplusplus)
|
||||||
# include <boost/config/select_stdlib_config.hpp>
|
# include <boost/config/select_stdlib_config.hpp>
|
||||||
#endif
|
#endif
|
||||||
// if we have a std library config, include it now:
|
// if we have a std library config, include it now:
|
||||||
|
@ -56,6 +56,7 @@
|
|||||||
# define BOOST_NO_CV_VOID_SPECIALIZATIONS
|
# define BOOST_NO_CV_VOID_SPECIALIZATIONS
|
||||||
# define BOOST_NO_DEDUCED_TYPENAME
|
# define BOOST_NO_DEDUCED_TYPENAME
|
||||||
// workaround for missing WCHAR_MAX/WCHAR_MIN:
|
// workaround for missing WCHAR_MAX/WCHAR_MIN:
|
||||||
|
#ifdef __cplusplus
|
||||||
#include <climits>
|
#include <climits>
|
||||||
#include <cwchar>
|
#include <cwchar>
|
||||||
#ifndef WCHAR_MAX
|
#ifndef WCHAR_MAX
|
||||||
@ -65,9 +66,10 @@
|
|||||||
# define WCHAR_MIN 0
|
# define WCHAR_MIN 0
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
#endif // __cplusplus
|
||||||
|
|
||||||
// Borland C++ Builder 6 and below:
|
// Borland C++ Builder 6 and below:
|
||||||
#if (__BORLANDC__ <= 0x564)
|
#if (__BORLANDC__ <= 0x564) && defined(__cplusplus)
|
||||||
|
|
||||||
# ifdef NDEBUG
|
# ifdef NDEBUG
|
||||||
// fix broken <cstring> so that Boost.test works:
|
// fix broken <cstring> so that Boost.test works:
|
||||||
|
@ -60,7 +60,7 @@
|
|||||||
// (Niels Dekker, LKEB, April 2010)
|
// (Niels Dekker, LKEB, April 2010)
|
||||||
# define BOOST_NO_COMPLETE_VALUE_INITIALIZATION
|
# define BOOST_NO_COMPLETE_VALUE_INITIALIZATION
|
||||||
|
|
||||||
# ifdef NDEBUG
|
# if defined(NDEBUG) && defined(__cplusplus)
|
||||||
// fix broken <cstring> so that Boost.test works:
|
// fix broken <cstring> so that Boost.test works:
|
||||||
# include <cstring>
|
# include <cstring>
|
||||||
# undef strcmp
|
# undef strcmp
|
||||||
|
@ -44,7 +44,9 @@
|
|||||||
//
|
//
|
||||||
// Is this really the best way to detect whether the std lib is in namespace std?
|
// Is this really the best way to detect whether the std lib is in namespace std?
|
||||||
//
|
//
|
||||||
|
#ifdef __cplusplus
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
|
#endif
|
||||||
#if !defined(__STL_IMPORT_VENDOR_CSTD) && !defined(_STLP_IMPORT_VENDOR_CSTD)
|
#if !defined(__STL_IMPORT_VENDOR_CSTD) && !defined(_STLP_IMPORT_VENDOR_CSTD)
|
||||||
# define BOOST_NO_STDC_NAMESPACE
|
# define BOOST_NO_STDC_NAMESPACE
|
||||||
#endif
|
#endif
|
||||||
|
@ -121,6 +121,7 @@
|
|||||||
// in type_traits code among other things, getting this correct
|
// in type_traits code among other things, getting this correct
|
||||||
// for the Intel compiler is actually remarkably fragile and tricky:
|
// for the Intel compiler is actually remarkably fragile and tricky:
|
||||||
//
|
//
|
||||||
|
#ifdef __cplusplus
|
||||||
#if defined(BOOST_NO_INTRINSIC_WCHAR_T)
|
#if defined(BOOST_NO_INTRINSIC_WCHAR_T)
|
||||||
#include <cwchar>
|
#include <cwchar>
|
||||||
template< typename T > struct assert_no_intrinsic_wchar_t;
|
template< typename T > struct assert_no_intrinsic_wchar_t;
|
||||||
@ -134,6 +135,7 @@ template<> struct assert_intrinsic_wchar_t<wchar_t> {};
|
|||||||
// if you see an error here then define BOOST_NO_INTRINSIC_WCHAR_T on the command line:
|
// if you see an error here then define BOOST_NO_INTRINSIC_WCHAR_T on the command line:
|
||||||
template<> struct assert_intrinsic_wchar_t<unsigned short> {};
|
template<> struct assert_intrinsic_wchar_t<unsigned short> {};
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(_MSC_VER) && (_MSC_VER+0 >= 1000)
|
#if defined(_MSC_VER) && (_MSC_VER+0 >= 1000)
|
||||||
# if _MSC_VER >= 1200
|
# if _MSC_VER >= 1200
|
||||||
|
@ -11,7 +11,11 @@
|
|||||||
#define BOOST_PLATFORM "linux"
|
#define BOOST_PLATFORM "linux"
|
||||||
|
|
||||||
// make sure we have __GLIBC_PREREQ if available at all
|
// make sure we have __GLIBC_PREREQ if available at all
|
||||||
|
#ifdef __cplusplus
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
|
#else
|
||||||
|
#include <stdlib.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
//
|
//
|
||||||
// <stdint.h> added to glibc 2.1.1
|
// <stdint.h> added to glibc 2.1.1
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
#define BOOST_SYMBIAN 1
|
#define BOOST_SYMBIAN 1
|
||||||
|
|
||||||
|
|
||||||
#if defined(__S60_3X__)
|
#if defined(__S60_3X__) && defined(__cplusplus)
|
||||||
// Open C / C++ plugin was introdused in this SDK, earlier versions don't have CRT / STL
|
// Open C / C++ plugin was introdused in this SDK, earlier versions don't have CRT / STL
|
||||||
# define BOOST_S60_3rd_EDITION_FP2_OR_LATER_SDK
|
# define BOOST_S60_3rd_EDITION_FP2_OR_LATER_SDK
|
||||||
// make sure we have __GLIBC_PREREQ if available at all
|
// make sure we have __GLIBC_PREREQ if available at all
|
||||||
|
@ -14,7 +14,11 @@
|
|||||||
// First include <cstddef> to determine if some version of STLport is in use as the std lib
|
// First include <cstddef> to determine if some version of STLport is in use as the std lib
|
||||||
// (do not rely on this header being included since users can short-circuit this header
|
// (do not rely on this header being included since users can short-circuit this header
|
||||||
// if they know whose std lib they are using.)
|
// if they know whose std lib they are using.)
|
||||||
#include <cstddef>
|
#ifdef __cplusplus
|
||||||
|
# include <cstddef>
|
||||||
|
#else
|
||||||
|
# include <stddef.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)
|
#if defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)
|
||||||
// STLPort library; this _must_ come first, otherwise since
|
// STLPort library; this _must_ come first, otherwise since
|
||||||
|
@ -86,10 +86,12 @@
|
|||||||
# define BOOST_NO_STD_LOCALE
|
# define BOOST_NO_STD_LOCALE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
#include <typeinfo>
|
#include <typeinfo>
|
||||||
#if !_HAS_EXCEPTIONS
|
#if !_HAS_EXCEPTIONS
|
||||||
# define BOOST_NO_STD_TYPEINFO
|
# define BOOST_NO_STD_TYPEINFO
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
// C++0x headers implemented in 520 (as shipped by Microsoft)
|
// C++0x headers implemented in 520 (as shipped by Microsoft)
|
||||||
//
|
//
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
// config for libc++
|
// config for libc++
|
||||||
// Might need more in here later.
|
// Might need more in here later.
|
||||||
|
|
||||||
#if !defined(_LIBCPP_VERSION)
|
#if !defined(_LIBCPP_VERSION) && defined(__cplusplus)
|
||||||
# include <ciso646>
|
# include <ciso646>
|
||||||
# if !defined(_LIBCPP_VERSION)
|
# if !defined(_LIBCPP_VERSION)
|
||||||
# error "This is not libc++!"
|
# error "This is not libc++!"
|
||||||
|
@ -26,7 +26,9 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// check C lib version for <stdint.h>
|
// check C lib version for <stdint.h>
|
||||||
|
#ifdef __cplusplus
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(__MSL__) && (__MSL__ >= 0x5000)
|
#if defined(__MSL__) && (__MSL__ >= 0x5000)
|
||||||
# define BOOST_HAS_STDINT_H
|
# define BOOST_HAS_STDINT_H
|
||||||
|
@ -91,7 +91,7 @@
|
|||||||
//
|
//
|
||||||
// If this is GNU libstdc++2, then no <limits> and no std::wstring:
|
// If this is GNU libstdc++2, then no <limits> and no std::wstring:
|
||||||
//
|
//
|
||||||
#if (defined(__GNUC__) && (__GNUC__ < 3))
|
#if (defined(__GNUC__) && (__GNUC__ < 3) && defined(__cplusplus))
|
||||||
# include <string>
|
# include <string>
|
||||||
# if defined(__BASTRING__)
|
# if defined(__BASTRING__)
|
||||||
# define BOOST_NO_LIMITS
|
# define BOOST_NO_LIMITS
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
// STLPort standard library config:
|
// STLPort standard library config:
|
||||||
|
|
||||||
#if !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION)
|
#if !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION) && defined(__cplusplus)
|
||||||
# include <cstddef>
|
# include <cstddef>
|
||||||
# if !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION)
|
# if !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION)
|
||||||
# error "This is not STLPort!"
|
# error "This is not STLPort!"
|
||||||
@ -203,7 +203,7 @@ namespace std{ using _STLP_VENDOR_CSTD::strcmp; using _STLP_VENDOR_CSTD::strcpy;
|
|||||||
//
|
//
|
||||||
// gcc-2.95.3/STLPort does not like the using declarations we use to get ADL with std::min/max
|
// gcc-2.95.3/STLPort does not like the using declarations we use to get ADL with std::min/max
|
||||||
//
|
//
|
||||||
#if defined(__GNUC__) && (__GNUC__ < 3)
|
#if defined(__GNUC__) && (__GNUC__ < 3) && defined(__cplusplus)
|
||||||
# include <algorithm> // for std::min and std::max
|
# include <algorithm> // for std::min and std::max
|
||||||
# define BOOST_USING_STD_MIN() ((void)0)
|
# define BOOST_USING_STD_MIN() ((void)0)
|
||||||
# define BOOST_USING_STD_MAX() ((void)0)
|
# define BOOST_USING_STD_MAX() ((void)0)
|
||||||
|
@ -379,7 +379,7 @@
|
|||||||
// works as expected with standard conforming compilers. The resulting
|
// works as expected with standard conforming compilers. The resulting
|
||||||
// double inclusion of <cstddef> is harmless.
|
// double inclusion of <cstddef> is harmless.
|
||||||
|
|
||||||
# ifdef BOOST_NO_STDC_NAMESPACE
|
# if defined(BOOST_NO_STDC_NAMESPACE) && defined(__cplusplus)
|
||||||
# include <cstddef>
|
# include <cstddef>
|
||||||
namespace std { using ::ptrdiff_t; using ::size_t; }
|
namespace std { using ::ptrdiff_t; using ::size_t; }
|
||||||
# endif
|
# endif
|
||||||
@ -398,7 +398,7 @@
|
|||||||
|
|
||||||
// BOOST_NO_STD_MIN_MAX workaround -----------------------------------------//
|
// BOOST_NO_STD_MIN_MAX workaround -----------------------------------------//
|
||||||
|
|
||||||
# ifdef BOOST_NO_STD_MIN_MAX
|
# if defined(BOOST_NO_STD_MIN_MAX) && defined(__cplusplus)
|
||||||
|
|
||||||
namespace std {
|
namespace std {
|
||||||
template <class _Tp>
|
template <class _Tp>
|
||||||
@ -509,7 +509,7 @@ namespace std {
|
|||||||
// but it's use may generate either warnings (with -ansi), or errors
|
// but it's use may generate either warnings (with -ansi), or errors
|
||||||
// (with -pedantic -ansi) unless it's use is prefixed by __extension__
|
// (with -pedantic -ansi) unless it's use is prefixed by __extension__
|
||||||
//
|
//
|
||||||
#if defined(BOOST_HAS_LONG_LONG)
|
#if defined(BOOST_HAS_LONG_LONG) && defined(__cplusplus)
|
||||||
namespace boost{
|
namespace boost{
|
||||||
# ifdef __GNUC__
|
# ifdef __GNUC__
|
||||||
__extension__ typedef long long long_long_type;
|
__extension__ typedef long long long_long_type;
|
||||||
@ -563,7 +563,7 @@ namespace boost{
|
|||||||
//
|
//
|
||||||
|
|
||||||
|
|
||||||
#if defined BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS
|
#if defined(BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS) && defined(__cplusplus)
|
||||||
|
|
||||||
# include "boost/type.hpp"
|
# include "boost/type.hpp"
|
||||||
# include "boost/non_type.hpp"
|
# include "boost/non_type.hpp"
|
||||||
@ -601,7 +601,7 @@ namespace boost{
|
|||||||
|
|
||||||
// When BOOST_NO_STD_TYPEINFO is defined, we can just import
|
// When BOOST_NO_STD_TYPEINFO is defined, we can just import
|
||||||
// the global definition into std namespace:
|
// the global definition into std namespace:
|
||||||
#ifdef BOOST_NO_STD_TYPEINFO
|
#if defined(BOOST_NO_STD_TYPEINFO) && defined(__cplusplus)
|
||||||
#include <typeinfo>
|
#include <typeinfo>
|
||||||
namespace std{ using ::type_info; }
|
namespace std{ using ::type_info; }
|
||||||
#endif
|
#endif
|
||||||
|
@ -24,7 +24,8 @@ if $(is_unix)
|
|||||||
}
|
}
|
||||||
|
|
||||||
test-suite config
|
test-suite config
|
||||||
:
|
:
|
||||||
|
[ compile config_test_c.c ]
|
||||||
[ run config_test.cpp
|
[ run config_test.cpp
|
||||||
: #args
|
: #args
|
||||||
: #input-files
|
: #input-files
|
||||||
|
9
test/config_test_c.c
Normal file
9
test/config_test_c.c
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
|
||||||
|
|
||||||
|
#include <boost/config.hpp>
|
||||||
|
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
Reference in New Issue
Block a user