MessagePack for C++
Loading...
Searching...
No Matches
config.hpp
Go to the documentation of this file.
1# /* **************************************************************************
2# * *
3# * (C) Copyright Paul Mensonides 2002-2011. *
4# * (C) Copyright Edward Diener 2011. *
5# * Distributed under the Boost Software License, Version 1.0. (See *
6# * accompanying file LICENSE_1_0.txt or copy at *
7# * http://www.boost.org/LICENSE_1_0.txt) *
8# * *
9# ************************************************************************** */
10#
11# /* See http://www.boost.org for most recent version. */
12#
13# ifndef MSGPACK_PREPROCESSOR_CONFIG_CONFIG_HPP
14# define MSGPACK_PREPROCESSOR_CONFIG_CONFIG_HPP
15#
16# /* MSGPACK_PP_CONFIG_FLAGS */
17#
18# define MSGPACK_PP_CONFIG_STRICT() 0x0001
19# define MSGPACK_PP_CONFIG_IDEAL() 0x0002
20#
21# define MSGPACK_PP_CONFIG_MSVC() 0x0004
22# define MSGPACK_PP_CONFIG_MWCC() 0x0008
23# define MSGPACK_PP_CONFIG_BCC() 0x0010
24# define MSGPACK_PP_CONFIG_EDG() 0x0020
25# define MSGPACK_PP_CONFIG_DMC() 0x0040
26#
27# if !defined(__clang__) && (!defined(_MSVC_TRADITIONAL) || _MSVC_TRADITIONAL)
28# define MSGPACK_TRADITIONAL_MSVC 1
29# else
30# define MSGPACK_TRADITIONAL_MSVC 0
31# endif
32#
33# ifndef MSGPACK_PP_CONFIG_FLAGS
34# if defined(__GCCXML__) || defined(__WAVE__) || defined(__MWERKS__) && __MWERKS__ >= 0x3200
35# define MSGPACK_PP_CONFIG_FLAGS() (MSGPACK_PP_CONFIG_STRICT())
36# elif defined(__EDG__) || defined(__EDG_VERSION__)
37# if defined(_MSC_VER) && MSGPACK_TRADITIONAL_MSVC && (defined(__INTELLISENSE__) || __EDG_VERSION__ >= 308)
38# define MSGPACK_PP_CONFIG_FLAGS() (MSGPACK_PP_CONFIG_MSVC())
39# else
40# define MSGPACK_PP_CONFIG_FLAGS() (MSGPACK_PP_CONFIG_EDG() | MSGPACK_PP_CONFIG_STRICT())
41# endif
42# elif defined(_MSC_VER) && !MSGPACK_TRADITIONAL_MSVC
43# define MSGPACK_PP_CONFIG_FLAGS() (MSGPACK_PP_CONFIG_STRICT())
44# elif defined(__MWERKS__)
45# define MSGPACK_PP_CONFIG_FLAGS() (MSGPACK_PP_CONFIG_MWCC())
46# elif defined(__DMC__)
47# define MSGPACK_PP_CONFIG_FLAGS() (MSGPACK_PP_CONFIG_DMC())
48# elif defined(__BORLANDC__) && __BORLANDC__ >= 0x581
49# define MSGPACK_PP_CONFIG_FLAGS() (MSGPACK_PP_CONFIG_STRICT())
50# elif defined(__BORLANDC__) || defined(__IBMC__) || defined(__IBMCPP__) || defined(__SUNPRO_CC)
51# define MSGPACK_PP_CONFIG_FLAGS() (MSGPACK_PP_CONFIG_BCC())
52# elif defined(_MSC_VER)
53# define MSGPACK_PP_CONFIG_FLAGS() (MSGPACK_PP_CONFIG_MSVC())
54# else
55# define MSGPACK_PP_CONFIG_FLAGS() (MSGPACK_PP_CONFIG_STRICT())
56# endif
57# endif
58#
59# /* MSGPACK_PP_CONFIG_EXTENDED_LINE_INFO */
60#
61# ifndef MSGPACK_PP_CONFIG_EXTENDED_LINE_INFO
62# define MSGPACK_PP_CONFIG_EXTENDED_LINE_INFO 0
63# endif
64#
65# /* MSGPACK_PP_CONFIG_ERRORS */
66#
67# ifndef MSGPACK_PP_CONFIG_ERRORS
68# ifdef NDEBUG
69# define MSGPACK_PP_CONFIG_ERRORS 0
70# else
71# define MSGPACK_PP_CONFIG_ERRORS 1
72# endif
73# endif
74#
75# /* MSGPACK_PP_VARIADICS */
76#
77# define MSGPACK_PP_VARIADICS_MSVC 0
78# if !defined MSGPACK_PP_VARIADICS
79# /* variadic support explicitly disabled for all untested compilers */
80# if defined __GCCXML__ || defined __PATHSCALE__ || defined __DMC__ || defined __CODEGEARC__ || defined __BORLANDC__ || defined __MWERKS__ || ( defined __SUNPRO_CC && __SUNPRO_CC < 0x5120 ) || defined __HP_aCC && !defined __EDG__ || defined __MRC__ || defined __SC__ || defined __PGI
81# define MSGPACK_PP_VARIADICS 0
82# elif defined(__CUDACC__)
83# define MSGPACK_PP_VARIADICS 1
84# elif defined(_MSC_VER) && !MSGPACK_TRADITIONAL_MSVC
85# define MSGPACK_PP_VARIADICS 1
86# /* VC++ (C/C++) and Intel C++ Compiler >= 17.0 with MSVC */
87# elif defined _MSC_VER && _MSC_VER >= 1400 && (!defined __EDG__ || defined(__INTELLISENSE__) || defined(__INTEL_COMPILER) && __INTEL_COMPILER >= 1700)
88# define MSGPACK_PP_VARIADICS 1
89# undef MSGPACK_PP_VARIADICS_MSVC
90# define MSGPACK_PP_VARIADICS_MSVC 1
91# /* Wave (C/C++), GCC (C++) */
92# elif defined __WAVE__ && __WAVE_HAS_VARIADICS__ || defined __GNUC__ && defined __GXX_EXPERIMENTAL_CXX0X__ && __GXX_EXPERIMENTAL_CXX0X__
93# define MSGPACK_PP_VARIADICS 1
94# /* EDG-based (C/C++), GCC (C), and unknown (C/C++) */
95# elif !defined __cplusplus && __STDC_VERSION__ >= 199901L || __cplusplus >= 201103L
96# define MSGPACK_PP_VARIADICS 1
97# else
98# define MSGPACK_PP_VARIADICS 0
99# endif
100# elif !MSGPACK_PP_VARIADICS + 1 < 2
101# undef MSGPACK_PP_VARIADICS
102# define MSGPACK_PP_VARIADICS 1
103# if defined _MSC_VER && _MSC_VER >= 1400 && MSGPACK_TRADITIONAL_MSVC && (defined(__INTELLISENSE__) || (defined(__INTEL_COMPILER) && __INTEL_COMPILER >= 1700) || !(defined __EDG__ || defined __GCCXML__ || defined __CUDACC__ || defined __PATHSCALE__ || defined __DMC__ || defined __CODEGEARC__ || defined __BORLANDC__ || defined __MWERKS__ || defined __SUNPRO_CC || defined __HP_aCC || defined __MRC__ || defined __SC__ || defined __IBMCPP__ || defined __PGI))
104# undef MSGPACK_PP_VARIADICS_MSVC
105# define MSGPACK_PP_VARIADICS_MSVC 1
106# endif
107# else
108# undef MSGPACK_PP_VARIADICS
109# define MSGPACK_PP_VARIADICS 0
110# endif
111#
112# endif