From b6d4bb5cb0e9ba9575bf2e022998dcd3b39f3bf1 Mon Sep 17 00:00:00 2001 From: Nathan Froyd Date: Fri, 31 Aug 2018 14:12:08 -0400 Subject: [PATCH] update boost predef and preprocessor from 1.61.0 to 1.68.0 ...via `git submodule foreach git pull origin boost-1.68.0` and initializing cmake. Fixes #728. --- Files.cmake | 13 +++ external/boost/predef | 2 +- external/boost/preprocessor | 2 +- include/msgpack/predef/architecture.h | 1 + include/msgpack/predef/architecture/arm.h | 12 ++- include/msgpack/predef/architecture/parisc.h | 2 +- include/msgpack/predef/architecture/ptx.h | 44 ++++++++++ include/msgpack/predef/compiler.h | 1 + include/msgpack/predef/compiler/intel.h | 20 ++++- include/msgpack/predef/compiler/nvcc.h | 60 +++++++++++++ include/msgpack/predef/compiler/visualc.h | 16 +++- include/msgpack/predef/hardware/simd/arm.h | 4 +- .../predef/hardware/simd/x86_amd/versions.h | 6 +- include/msgpack/predef/language.h | 1 + include/msgpack/predef/language/cuda.h | 52 +++++++++++ include/msgpack/predef/library/c.h | 1 + include/msgpack/predef/library/c/cloudabi.h | 53 +++++++++++ include/msgpack/predef/make.h | 8 ++ include/msgpack/predef/os/android.h | 4 +- include/msgpack/predef/os/bsd/free.h | 13 ++- include/msgpack/predef/os/bsd/open.h | 80 +++++++++++++++++ include/msgpack/predef/other/endian.h | 3 +- include/msgpack/predef/other/workaround.h | 87 +++++++++++++++++++ include/msgpack/predef/platform.h | 11 ++- include/msgpack/predef/platform/cloudabi.h | 43 +++++++++ include/msgpack/predef/platform/ios.h | 58 +++++++++++++ include/msgpack/predef/platform/mingw.h | 8 +- include/msgpack/predef/platform/mingw32.h | 63 ++++++++++++++ include/msgpack/predef/platform/mingw64.h | 63 ++++++++++++++ .../msgpack/predef/platform/windows_desktop.h | 12 ++- .../msgpack/predef/platform/windows_phone.h | 9 +- .../msgpack/predef/platform/windows_runtime.h | 18 ++-- .../msgpack/predef/platform/windows_server.h | 47 ++++++++++ .../msgpack/predef/platform/windows_store.h | 15 +++- .../msgpack/predef/platform/windows_system.h | 47 ++++++++++ include/msgpack/predef/platform/windows_uwp.h | 60 +++++++++++++ include/msgpack/predef/version.h | 2 +- include/msgpack/predef/version_number.h | 21 ++++- include/msgpack/preprocessor/cat.hpp | 2 +- .../msgpack/preprocessor/config/config.hpp | 24 ++--- .../seq/detail/binary_transform.hpp | 11 ++- .../preprocessor/seq/detail/to_list_msvc.hpp | 55 ++++++++++++ include/msgpack/preprocessor/seq/to_list.hpp | 12 +++ 43 files changed, 1007 insertions(+), 59 deletions(-) create mode 100644 include/msgpack/predef/architecture/ptx.h create mode 100644 include/msgpack/predef/compiler/nvcc.h create mode 100644 include/msgpack/predef/language/cuda.h create mode 100644 include/msgpack/predef/library/c/cloudabi.h create mode 100644 include/msgpack/predef/other/workaround.h create mode 100644 include/msgpack/predef/platform/cloudabi.h create mode 100644 include/msgpack/predef/platform/ios.h create mode 100644 include/msgpack/predef/platform/mingw32.h create mode 100644 include/msgpack/predef/platform/mingw64.h create mode 100644 include/msgpack/predef/platform/windows_server.h create mode 100644 include/msgpack/predef/platform/windows_system.h create mode 100644 include/msgpack/predef/platform/windows_uwp.h create mode 100644 include/msgpack/preprocessor/seq/detail/to_list_msvc.hpp diff --git a/Files.cmake b/Files.cmake index c671e6b6..d3a204fb 100644 --- a/Files.cmake +++ b/Files.cmake @@ -24,6 +24,7 @@ LIST (APPEND msgpackc_HEADERS include/msgpack/predef/architecture/mips.h include/msgpack/predef/architecture/parisc.h include/msgpack/predef/architecture/ppc.h + include/msgpack/predef/architecture/ptx.h include/msgpack/predef/architecture/pyramid.h include/msgpack/predef/architecture/rs6k.h include/msgpack/predef/architecture/sparc.h @@ -57,6 +58,7 @@ LIST (APPEND msgpackc_HEADERS include/msgpack/predef/compiler/metrowerks.h include/msgpack/predef/compiler/microtec.h include/msgpack/predef/compiler/mpw.h + include/msgpack/predef/compiler/nvcc.h include/msgpack/predef/compiler/palm.h include/msgpack/predef/compiler/pgi.h include/msgpack/predef/compiler/sgi_mipspro.h @@ -83,12 +85,14 @@ LIST (APPEND msgpackc_HEADERS include/msgpack/predef/hardware/simd/x86_amd.h include/msgpack/predef/hardware/simd/x86_amd/versions.h include/msgpack/predef/language.h + include/msgpack/predef/language/cuda.h include/msgpack/predef/language/objc.h include/msgpack/predef/language/stdc.h include/msgpack/predef/language/stdcpp.h include/msgpack/predef/library.h include/msgpack/predef/library/c.h include/msgpack/predef/library/c/_prefix.h + include/msgpack/predef/library/c/cloudabi.h include/msgpack/predef/library/c/gnu.h include/msgpack/predef/library/c/uc.h include/msgpack/predef/library/c/vms.h @@ -132,12 +136,20 @@ LIST (APPEND msgpackc_HEADERS include/msgpack/predef/os/windows.h include/msgpack/predef/other.h include/msgpack/predef/other/endian.h + include/msgpack/predef/other/workaround.h include/msgpack/predef/platform.h + include/msgpack/predef/platform/cloudabi.h + include/msgpack/predef/platform/ios.h include/msgpack/predef/platform/mingw.h + include/msgpack/predef/platform/mingw32.h + include/msgpack/predef/platform/mingw64.h include/msgpack/predef/platform/windows_desktop.h include/msgpack/predef/platform/windows_phone.h include/msgpack/predef/platform/windows_runtime.h + include/msgpack/predef/platform/windows_server.h include/msgpack/predef/platform/windows_store.h + include/msgpack/predef/platform/windows_system.h + include/msgpack/predef/platform/windows_uwp.h include/msgpack/predef/version.h include/msgpack/predef/version_number.h include/msgpack/sbuffer.h @@ -444,6 +456,7 @@ IF (MSGPACK_ENABLE_CXX) include/msgpack/preprocessor/seq/detail/binary_transform.hpp include/msgpack/preprocessor/seq/detail/is_empty.hpp include/msgpack/preprocessor/seq/detail/split.hpp + include/msgpack/preprocessor/seq/detail/to_list_msvc.hpp include/msgpack/preprocessor/seq/elem.hpp include/msgpack/preprocessor/seq/enum.hpp include/msgpack/preprocessor/seq/filter.hpp diff --git a/external/boost/predef b/external/boost/predef index 1e8d1c2c..560ff529 160000 --- a/external/boost/predef +++ b/external/boost/predef @@ -1 +1 @@ -Subproject commit 1e8d1c2cfcac343305e2182f665742b9e38f7452 +Subproject commit 560ff5298ead78276872604f1ee6523e63a4fa90 diff --git a/external/boost/preprocessor b/external/boost/preprocessor index c2beb74b..56090c56 160000 --- a/external/boost/preprocessor +++ b/external/boost/preprocessor @@ -1 +1 @@ -Subproject commit c2beb74b90969f369c62d0dea68aa5f0e203268e +Subproject commit 56090c56b5c78418b6dbe8c3c2ba576395152f83 diff --git a/include/msgpack/predef/architecture.h b/include/msgpack/predef/architecture.h index 63879a03..2a615cf1 100644 --- a/include/msgpack/predef/architecture.h +++ b/include/msgpack/predef/architecture.h @@ -19,6 +19,7 @@ http://www.boost.org/LICENSE_1_0.txt) #include #include #include +#include #include #include #include diff --git a/include/msgpack/predef/architecture/arm.h b/include/msgpack/predef/architecture/arm.h index c37f2d13..4421824b 100644 --- a/include/msgpack/predef/architecture/arm.h +++ b/include/msgpack/predef/architecture/arm.h @@ -27,11 +27,14 @@ http://www.boost.org/LICENSE_1_0.txt) [[`__TARGET_ARCH_ARM`] [__predef_detection__]] [[`__TARGET_ARCH_THUMB`] [__predef_detection__]] [[`_M_ARM`] [__predef_detection__]] + [[`_M_ARM64`] [__predef_detection__]] [[`__arm64`] [8.0.0]] [[`__TARGET_ARCH_ARM`] [V.0.0]] [[`__TARGET_ARCH_THUMB`] [V.0.0]] + [[`__ARM_ARCH`] [V.0.0]] [[`_M_ARM`] [V.0.0]] + [[`_M_ARM64`] [8.0.0]] ] */ @@ -39,7 +42,8 @@ http://www.boost.org/LICENSE_1_0.txt) #if defined(__arm__) || defined(__arm64) || defined(__thumb__) || \ defined(__TARGET_ARCH_ARM) || defined(__TARGET_ARCH_THUMB) || \ - defined(_M_ARM) + defined(__ARM_ARCH) || \ + defined(_M_ARM) || defined(_M_ARM64) # undef MSGPACK_ARCH_ARM # if !defined(MSGPACK_ARCH_ARM) && defined(__arm64) # define MSGPACK_ARCH_ARM MSGPACK_VERSION_NUMBER(8,0,0) @@ -50,6 +54,12 @@ http://www.boost.org/LICENSE_1_0.txt) # if !defined(MSGPACK_ARCH_ARM) && defined(__TARGET_ARCH_THUMB) # define MSGPACK_ARCH_ARM MSGPACK_VERSION_NUMBER(__TARGET_ARCH_THUMB,0,0) # endif +# if !defined(MSGPACK_ARCH_ARM) && defined(__ARM_ARCH) +# define MSGPACK_ARCH_ARM MSGPACK_VERSION_NUMBER(__ARM_ARCH,0,0) +# endif +# if !defined(MSGPACK_ARCH_ARM) && defined(_M_ARM64) +# define MSGPACK_ARCH_ARM MSGPACK_VERSION_NUMBER(8,0,0) +# endif # if !defined(MSGPACK_ARCH_ARM) && defined(_M_ARM) # define MSGPACK_ARCH_ARM MSGPACK_VERSION_NUMBER(_M_ARM,0,0) # endif diff --git a/include/msgpack/predef/architecture/parisc.h b/include/msgpack/predef/architecture/parisc.h index bbd8aa16..cb6a3087 100644 --- a/include/msgpack/predef/architecture/parisc.h +++ b/include/msgpack/predef/architecture/parisc.h @@ -12,7 +12,7 @@ http://www.boost.org/LICENSE_1_0.txt) #include /*` -[heading `MSGPACK_ARCH_PARISK`] +[heading `MSGPACK_ARCH_PARISC`] [@http://en.wikipedia.org/wiki/PA-RISC_family HP/PA RISC] architecture. diff --git a/include/msgpack/predef/architecture/ptx.h b/include/msgpack/predef/architecture/ptx.h new file mode 100644 index 00000000..686c5eed --- /dev/null +++ b/include/msgpack/predef/architecture/ptx.h @@ -0,0 +1,44 @@ +/* +Copyright Benjamin Worpitz 2018 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_ARCHITECTURE_PTX_H +#define MSGPACK_PREDEF_ARCHITECTURE_PTX_H + +#include +#include + +/*` +[heading `MSGPACK_ARCH_PTX`] + +[@https://en.wikipedia.org/wiki/Parallel_Thread_Execution PTX] architecture. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__CUDA_ARCH__`] [__predef_detection__]] + + [[`__CUDA_ARCH__`] [V.R.0]] + ] + */ + +#define MSGPACK_ARCH_PTX MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__CUDA_ARCH__) +# undef MSGPACK_ARCH_PTX +# define MSGPACK_ARCH_PTX MSGPACK_PREDEF_MAKE_10_VR0(__CUDA_ARCH__) +#endif + +#if MSGPACK_ARCH_PTX +# define MSGPACK_ARCH_PTX_AVAILABLE +#endif + +#define MSGPACK_ARCH_PTX_NAME "PTX" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_ARCH_PTX,MSGPACK_ARCH_PTX_NAME) diff --git a/include/msgpack/predef/compiler.h b/include/msgpack/predef/compiler.h index 56058166..c4ebb2db 100644 --- a/include/msgpack/predef/compiler.h +++ b/include/msgpack/predef/compiler.h @@ -32,6 +32,7 @@ http://www.boost.org/LICENSE_1_0.txt) #include #include #include +#include #include #include #include diff --git a/include/msgpack/predef/compiler/intel.h b/include/msgpack/predef/compiler/intel.h index 7a1d76ef..c908b9db 100644 --- a/include/msgpack/predef/compiler/intel.h +++ b/include/msgpack/predef/compiler/intel.h @@ -1,5 +1,5 @@ /* -Copyright Rene Rivera 2008-2015 +Copyright Rene Rivera 2008-2017 Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -25,7 +25,8 @@ Version number available as major, minor, and patch. [[`__ICC`] [__predef_detection__]] [[`__ECC`] [__predef_detection__]] - [[`__INTEL_COMPILER`] [V.R.P]] + [[`__INTEL_COMPILER`] [V.R]] + [[`__INTEL_COMPILER` and `__INTEL_COMPILER_UPDATE`] [V.R.P]] ] */ @@ -33,8 +34,21 @@ Version number available as major, minor, and patch. #if defined(__INTEL_COMPILER) || defined(__ICL) || defined(__ICC) || \ defined(__ECC) +/*` +[note Because of an Intel mistake in the release version numbering when +`__INTEL_COMPILER` is `9999` it is detected as version 12.1.0.] + */ +# if !defined(MSGPACK_COMP_INTEL_DETECTION) && defined(__INTEL_COMPILER) && (__INTEL_COMPILER == 9999) +# define MSGPACK_COMP_INTEL_DETECTION MSGPACK_VERSION_NUMBER(12,1,0) +# endif +# if !defined(MSGPACK_COMP_INTEL_DETECTION) && defined(__INTEL_COMPILER) && defined(__INTEL_COMPILER_UPDATE) +# define MSGPACK_COMP_INTEL_DETECTION MSGPACK_VERSION_NUMBER( \ + MSGPACK_VERSION_NUMBER_MAJOR(MSGPACK_PREDEF_MAKE_10_VVRR(__INTEL_COMPILER)), \ + MSGPACK_VERSION_NUMBER_MINOR(MSGPACK_PREDEF_MAKE_10_VVRR(__INTEL_COMPILER)), \ + __INTEL_COMPILER_UPDATE) +# endif # if !defined(MSGPACK_COMP_INTEL_DETECTION) && defined(__INTEL_COMPILER) -# define MSGPACK_COMP_INTEL_DETECTION MSGPACK_PREDEF_MAKE_10_VRP(__INTEL_COMPILER) +# define MSGPACK_COMP_INTEL_DETECTION MSGPACK_PREDEF_MAKE_10_VVRR(__INTEL_COMPILER) # endif # if !defined(MSGPACK_COMP_INTEL_DETECTION) # define MSGPACK_COMP_INTEL_DETECTION MSGPACK_VERSION_NUMBER_AVAILABLE diff --git a/include/msgpack/predef/compiler/nvcc.h b/include/msgpack/predef/compiler/nvcc.h new file mode 100644 index 00000000..902e6372 --- /dev/null +++ b/include/msgpack/predef/compiler/nvcc.h @@ -0,0 +1,60 @@ +/* +Copyright Benjamin Worpitz 2018 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_COMPILER_NVCC_H +#define MSGPACK_PREDEF_COMPILER_NVCC_H + +#include +#include + +/*` +[heading `MSGPACK_COMP_NVCC`] + +[@https://en.wikipedia.org/wiki/NVIDIA_CUDA_Compiler NVCC] compiler. +Version number available as major, minor, and patch beginning with version 7.5. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__NVCC__`] [__predef_detection__]] + + [[`__CUDACC_VER_MAJOR__`, `__CUDACC_VER_MINOR__`, `__CUDACC_VER_BUILD__`] [V.R.P]] + ] + */ + +#define MSGPACK_COMP_NVCC MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__NVCC__) +# if !defined(__CUDACC_VER_MAJOR__) || !defined(__CUDACC_VER_MINOR__) || !defined(__CUDACC_VER_BUILD__) +# define MSGPACK_COMP_NVCC_DETECTION MSGPACK_VERSION_NUMBER_AVAILABLE +# else +# define MSGPACK_COMP_NVCC_DETECTION MSGPACK_VERSION_NUMBER(__CUDACC_VER_MAJOR__, __CUDACC_VER_MINOR__, __CUDACC_VER_BUILD__) +# endif +#endif + +#ifdef MSGPACK_COMP_NVCC_DETECTION +# if defined(MSGPACK_PREDEF_DETAIL_COMP_DETECTED) +# define MSGPACK_COMP_NVCC_EMULATED MSGPACK_COMP_NVCC_DETECTION +# else +# undef MSGPACK_COMP_NVCC +# define MSGPACK_COMP_NVCC MSGPACK_COMP_NVCC_DETECTION +# endif +# define MSGPACK_COMP_NVCC_AVAILABLE +# include +#endif + +#define MSGPACK_COMP_NVCC_NAME "NVCC" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_NVCC,MSGPACK_COMP_NVCC_NAME) + +#ifdef MSGPACK_COMP_NVCC_EMULATED +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_NVCC_EMULATED,MSGPACK_COMP_NVCC_NAME) +#endif diff --git a/include/msgpack/predef/compiler/visualc.h b/include/msgpack/predef/compiler/visualc.h index 547a5bf1..9cc3255a 100644 --- a/include/msgpack/predef/compiler/visualc.h +++ b/include/msgpack/predef/compiler/visualc.h @@ -29,6 +29,10 @@ Version number available as major, minor, and patch. [[`_MSC_FULL_VER`] [V.R.P]] [[`_MSC_VER`] [V.R.0]] ] + +[note Release of Visual Studio after 2015 will no longer be identified +by Boost Predef as the marketing version number. Instead we use the +compiler version number directly, i.e. the _MSC_VER number.] */ #define MSGPACK_COMP_MSVC MSGPACK_VERSION_NUMBER_NOT_AVAILABLE @@ -53,8 +57,18 @@ Version number available as major, minor, and patch. means that the compiler and VS product versions are no longer in sync. Hence we need to use different formulas for mapping from MSC version to VS product version. + + VS2017 is a total nightmare when it comes to version numbers. + Hence to avoid arguments relating to that both present and + future.. Any version after VS2015 will use solely the compiler + version, i.e. cl.exe, as the version number here. */ -# if (_MSC_VER >= 1900) +# if (_MSC_VER > 1900) +# define MSGPACK_COMP_MSVC_DETECTION MSGPACK_VERSION_NUMBER(\ + _MSC_VER/100,\ + _MSC_VER%100,\ + MSGPACK_COMP_MSVC_BUILD) +# elif (_MSC_VER >= 1900) # define MSGPACK_COMP_MSVC_DETECTION MSGPACK_VERSION_NUMBER(\ _MSC_VER/100-5,\ _MSC_VER%100,\ diff --git a/include/msgpack/predef/hardware/simd/arm.h b/include/msgpack/predef/hardware/simd/arm.h index 0c22dbdc..50a38299 100644 --- a/include/msgpack/predef/hardware/simd/arm.h +++ b/include/msgpack/predef/hardware/simd/arm.h @@ -24,6 +24,7 @@ http://www.boost.org/LICENSE_1_0.txt) [[`__ARM_NEON__`] [__predef_detection__]] [[`__aarch64__`] [__predef_detection__]] [[`_M_ARM`] [__predef_detection__]] + [[`_M_ARM64`] [__predef_detection__]] ] [table @@ -32,6 +33,7 @@ http://www.boost.org/LICENSE_1_0.txt) [[`__ARM_NEON__`] [MSGPACK_HW_SIMD_ARM_NEON_VERSION]] [[`__aarch64__`] [MSGPACK_HW_SIMD_ARM_NEON_VERSION]] [[`_M_ARM`] [MSGPACK_HW_SIMD_ARM_NEON_VERSION]] + [[`_M_ARM64`] [MSGPACK_HW_SIMD_ARM_NEON_VERSION]] ] */ @@ -39,7 +41,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define MSGPACK_HW_SIMD_ARM MSGPACK_VERSION_NUMBER_NOT_AVAILABLE #undef MSGPACK_HW_SIMD_ARM -#if !defined(MSGPACK_HW_SIMD_ARM) && (defined(__ARM_NEON__) || defined(__aarch64__) || defined (_M_ARM)) +#if !defined(MSGPACK_HW_SIMD_ARM) && (defined(__ARM_NEON__) || defined(__aarch64__) || defined (_M_ARM) || defined (_M_ARM64)) # define MSGPACK_HW_SIMD_ARM MSGPACK_HW_SIMD_ARM_NEON_VERSION #endif diff --git a/include/msgpack/predef/hardware/simd/x86_amd/versions.h b/include/msgpack/predef/hardware/simd/x86_amd/versions.h index 0bd45299..4d33db56 100644 --- a/include/msgpack/predef/hardware/simd/x86_amd/versions.h +++ b/include/msgpack/predef/hardware/simd/x86_amd/versions.h @@ -21,7 +21,7 @@ http://www.boost.org/LICENSE_1_0.txt) // --------------------------------- /*` - [heading `MSGPACK_HW_SIMD_X86_SSE4A_VERSION`] + [heading `MSGPACK_HW_SIMD_X86_AMD_SSE4A_VERSION`] [@https://en.wikipedia.org/wiki/SSE4##SSE4A SSE4A] x86 extension (AMD specific). @@ -30,7 +30,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define MSGPACK_HW_SIMD_X86_AMD_SSE4A_VERSION MSGPACK_VERSION_NUMBER(4, 0, 0) /*` - [heading `MSGPACK_HW_SIMD_X86_FMA4_VERSION`] + [heading `MSGPACK_HW_SIMD_X86_AMD_FMA4_VERSION`] [@https://en.wikipedia.org/wiki/FMA_instruction_set#FMA4_instruction_set FMA4] x86 extension (AMD specific). @@ -39,7 +39,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define MSGPACK_HW_SIMD_X86_AMD_FMA4_VERSION MSGPACK_VERSION_NUMBER(5, 1, 0) /*` - [heading `MSGPACK_HW_SIMD_X86_XOP_VERSION`] + [heading `MSGPACK_HW_SIMD_X86_AMD_XOP_VERSION`] [@https://en.wikipedia.org/wiki/XOP_instruction_set XOP] x86 extension (AMD specific). diff --git a/include/msgpack/predef/language.h b/include/msgpack/predef/language.h index 7652c32c..83ea3531 100644 --- a/include/msgpack/predef/language.h +++ b/include/msgpack/predef/language.h @@ -13,5 +13,6 @@ http://www.boost.org/LICENSE_1_0.txt) #include #include #include +#include #endif diff --git a/include/msgpack/predef/language/cuda.h b/include/msgpack/predef/language/cuda.h new file mode 100644 index 00000000..c7f4ccda --- /dev/null +++ b/include/msgpack/predef/language/cuda.h @@ -0,0 +1,52 @@ +/* +Copyright Benjamin Worpitz 2018 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_LANGUAGE_CUDA_H +#define MSGPACK_PREDEF_LANGUAGE_CUDA_H + +#include +#include + +/*` +[heading `MSGPACK_LANG_CUDA`] + +[@https://en.wikipedia.org/wiki/CUDA CUDA C/C++] language. +If available, the version is detected as VV.RR.P. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__CUDACC__`] [__predef_detection__]] + [[`__CUDA__`] [__predef_detection__]] + + [[`CUDA_VERSION`] [VV.RR.P]] + ] + */ + +#define MSGPACK_LANG_CUDA MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__CUDACC__) || defined(__CUDA__) +# undef MSGPACK_LANG_CUDA +# include +# if defined(CUDA_VERSION) +# define MSGPACK_LANG_CUDA MSGPACK_PREDEF_MAKE_10_VVRRP(CUDA_VERSION) +# else +# define MSGPACK_LANG_CUDA MSGPACK_VERSION_NUMBER_AVAILABLE +# endif +#endif + +#if MSGPACK_LANG_CUDA +# define MSGPACK_LANG_CUDA_AVAILABLE +#endif + +#define MSGPACK_LANG_CUDA_NAME "CUDA C/C++" + + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_LANG_CUDA,MSGPACK_LANG_CUDA_NAME) diff --git a/include/msgpack/predef/library/c.h b/include/msgpack/predef/library/c.h index 2817bf91..33e710e1 100644 --- a/include/msgpack/predef/library/c.h +++ b/include/msgpack/predef/library/c.h @@ -12,6 +12,7 @@ http://www.boost.org/LICENSE_1_0.txt) #include +#include #include #include #include diff --git a/include/msgpack/predef/library/c/cloudabi.h b/include/msgpack/predef/library/c/cloudabi.h new file mode 100644 index 00000000..2488cf40 --- /dev/null +++ b/include/msgpack/predef/library/c/cloudabi.h @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2017 James E. King III + * + * Distributed under the Boost Software License, Version 1.0. + * (See accompanying file LICENSE_1_0.txt or copy at + * http://www.boost.org/LICENSE_1_0.txt) + */ + +#ifndef MSGPACK_PREDEF_LIBRARY_C_CLOUDABI_H +#define MSGPACK_PREDEF_LIBRARY_C_CLOUDABI_H + +#include +#include + +#include + +#if defined(__CloudABI__) +#include +#endif + +/*` +[heading `MSGPACK_LIB_C_CLOUDABI`] + +[@https://github.com/NuxiNL/cloudlibc cloudlibc] - CloudABI's standard C library. +Version number available as major, and minor. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__cloudlibc__`] [__predef_detection__]] + + [[`__cloudlibc_major__`, `__cloudlibc_minor__`] [V.R.0]] + ] + */ + +#define MSGPACK_LIB_C_CLOUDABI MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__cloudlibc__) +# undef MSGPACK_LIB_C_CLOUDABI +# define MSGPACK_LIB_C_CLOUDABI \ + MSGPACK_VERSION_NUMBER(__cloudlibc_major__,__cloudlibc_minor__,0) +#endif + +#if MSGPACK_LIB_C_CLOUDABI +# define MSGPACK_LIB_C_CLOUDABI_AVAILABLE +#endif + +#define MSGPACK_LIB_C_CLOUDABI_NAME "cloudlibc" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_LIB_C_CLOUDABI,MSGPACK_LIB_C_CLOUDABI_NAME) diff --git a/include/msgpack/predef/make.h b/include/msgpack/predef/make.h index a0d8b128..26356f8e 100644 --- a/include/msgpack/predef/make.h +++ b/include/msgpack/predef/make.h @@ -46,10 +46,14 @@ Macros are: #define MSGPACK_PREDEF_MAKE_0X_VVRRPP(V) MSGPACK_VERSION_NUMBER((V&0xFF0000)>>16,(V&0xFF00)>>8,(V&0xFF)) /*` `MSGPACK_PREDEF_MAKE_10_VPPP(V)` */ #define MSGPACK_PREDEF_MAKE_10_VPPP(V) MSGPACK_VERSION_NUMBER(((V)/1000)%10,0,(V)%1000) +/*` `MSGPACK_PREDEF_MAKE_10_VR0(V)` */ +#define MSGPACK_PREDEF_MAKE_10_VR0(V) MSGPACK_VERSION_NUMBER(((V)/100)%10,((V)/10)%10,0) /*` `MSGPACK_PREDEF_MAKE_10_VRP(V)` */ #define MSGPACK_PREDEF_MAKE_10_VRP(V) MSGPACK_VERSION_NUMBER(((V)/100)%10,((V)/10)%10,(V)%10) /*` `MSGPACK_PREDEF_MAKE_10_VRP000(V)` */ #define MSGPACK_PREDEF_MAKE_10_VRP000(V) MSGPACK_VERSION_NUMBER(((V)/100000)%10,((V)/10000)%10,((V)/1000)%10) +/*` `MSGPACK_PREDEF_MAKE_10_VRPPPP(V)` */ +#define MSGPACK_PREDEF_MAKE_10_VRPPPP(V) MSGPACK_VERSION_NUMBER(((V)/100000)%10,((V)/10000)%10,(V)%10000) /*` `MSGPACK_PREDEF_MAKE_10_VRPP(V)` */ #define MSGPACK_PREDEF_MAKE_10_VRPP(V) MSGPACK_VERSION_NUMBER(((V)/1000)%10,((V)/100)%10,(V)%100) /*` `MSGPACK_PREDEF_MAKE_10_VRR(V)` */ @@ -62,8 +66,12 @@ Macros are: #define MSGPACK_PREDEF_MAKE_10_VV00(V) MSGPACK_VERSION_NUMBER(((V)/100)%100,0,0) /*` `MSGPACK_PREDEF_MAKE_10_VVRR(V)` */ #define MSGPACK_PREDEF_MAKE_10_VVRR(V) MSGPACK_VERSION_NUMBER(((V)/100)%100,(V)%100,0) +/*` `MSGPACK_PREDEF_MAKE_10_VVRRP(V)` */ +#define MSGPACK_PREDEF_MAKE_10_VVRRP(V) MSGPACK_VERSION_NUMBER(((V)/1000)%100,((V)/10)%100,(V)%10) /*` `MSGPACK_PREDEF_MAKE_10_VVRRPP(V)` */ #define MSGPACK_PREDEF_MAKE_10_VVRRPP(V) MSGPACK_VERSION_NUMBER(((V)/10000)%100,((V)/100)%100,(V)%100) +/*` `MSGPACK_PREDEF_MAKE_10_VVRRPPP(V)` */ +#define MSGPACK_PREDEF_MAKE_10_VVRRPPP(V) MSGPACK_VERSION_NUMBER(((V)/100000)%100,((V)/1000)%100,(V)%1000) /*` `MSGPACK_PREDEF_MAKE_10_VVRR0PP00(V)` */ #define MSGPACK_PREDEF_MAKE_10_VVRR0PP00(V) MSGPACK_VERSION_NUMBER(((V)/10000000)%100,((V)/100000)%100,((V)/100)%100) /*` `MSGPACK_PREDEF_MAKE_10_VVRR0PPPP(V)` */ diff --git a/include/msgpack/predef/os/android.h b/include/msgpack/predef/os/android.h index 14195ea8..40f58038 100644 --- a/include/msgpack/predef/os/android.h +++ b/include/msgpack/predef/os/android.h @@ -5,8 +5,8 @@ Distributed under the Boost Software License, Version 1.0. http://www.boost.org/LICENSE_1_0.txt) */ -#ifndef MSGPACK_PREDEF_OS_ADROID_H -#define MSGPACK_PREDEF_OS_ADROID_H +#ifndef MSGPACK_PREDEF_OS_ANDROID_H +#define MSGPACK_PREDEF_OS_ANDROID_H #include #include diff --git a/include/msgpack/predef/os/bsd/free.h b/include/msgpack/predef/os/bsd/free.h index 29cc2db4..64862bdb 100644 --- a/include/msgpack/predef/os/bsd/free.h +++ b/include/msgpack/predef/os/bsd/free.h @@ -34,13 +34,20 @@ http://www.boost.org/LICENSE_1_0.txt) # define MSGPACK_OS_BSD_AVAILABLE # endif # undef MSGPACK_OS_BSD_FREE +# include # if defined(__FreeBSD_version) -# if __FreeBSD_version < 500000 +# if __FreeBSD_version == 491000 # define MSGPACK_OS_BSD_FREE \ - MSGPACK_PREDEF_MAKE_10_VRP000(__FreeBSD_version) + MSGPACK_VERSION_NUMBER(4, 10, 0) +# elif __FreeBSD_version == 492000 +# define MSGPACK_OS_BSD_FREE \ + MSGPACK_VERSION_NUMBER(4, 11, 0) +# elif __FreeBSD_version < 500000 +# define MSGPACK_OS_BSD_FREE \ + MSGPACK_PREDEF_MAKE_10_VRPPPP(__FreeBSD_version) # else # define MSGPACK_OS_BSD_FREE \ - MSGPACK_PREDEF_MAKE_10_VRR000(__FreeBSD_version) + MSGPACK_PREDEF_MAKE_10_VVRRPPP(__FreeBSD_version) # endif # else # define MSGPACK_OS_BSD_FREE MSGPACK_VERSION_NUMBER_AVAILABLE diff --git a/include/msgpack/predef/os/bsd/open.h b/include/msgpack/predef/os/bsd/open.h index 3c14b014..2492847e 100644 --- a/include/msgpack/predef/os/bsd/open.h +++ b/include/msgpack/predef/os/bsd/open.h @@ -50,6 +50,26 @@ http://www.boost.org/LICENSE_1_0.txt) [[`OpenBSD4_7`] [4.7.0]] [[`OpenBSD4_8`] [4.8.0]] [[`OpenBSD4_9`] [4.9.0]] + [[`OpenBSD5_0`] [5.0.0]] + [[`OpenBSD5_1`] [5.1.0]] + [[`OpenBSD5_2`] [5.2.0]] + [[`OpenBSD5_3`] [5.3.0]] + [[`OpenBSD5_4`] [5.4.0]] + [[`OpenBSD5_5`] [5.5.0]] + [[`OpenBSD5_6`] [5.6.0]] + [[`OpenBSD5_7`] [5.7.0]] + [[`OpenBSD5_8`] [5.8.0]] + [[`OpenBSD5_9`] [5.9.0]] + [[`OpenBSD6_0`] [6.0.0]] + [[`OpenBSD6_1`] [6.1.0]] + [[`OpenBSD6_2`] [6.2.0]] + [[`OpenBSD6_3`] [6.3.0]] + [[`OpenBSD6_4`] [6.4.0]] + [[`OpenBSD6_5`] [6.5.0]] + [[`OpenBSD6_6`] [6.6.0]] + [[`OpenBSD6_7`] [6.7.0]] + [[`OpenBSD6_8`] [6.8.0]] + [[`OpenBSD6_9`] [6.9.0]] ] */ @@ -153,6 +173,66 @@ http://www.boost.org/LICENSE_1_0.txt) # if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD4_9) # define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(4,9,0) # endif +# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD5_0) +# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(5,0,0) +# endif +# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD5_1) +# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(5,1,0) +# endif +# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD5_2) +# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(5,2,0) +# endif +# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD5_3) +# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(5,3,0) +# endif +# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD5_4) +# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(5,4,0) +# endif +# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD5_5) +# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(5,5,0) +# endif +# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD5_6) +# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(5,6,0) +# endif +# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD5_7) +# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(5,7,0) +# endif +# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD5_8) +# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(5,8,0) +# endif +# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD5_9) +# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(5,9,0) +# endif +# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD6_0) +# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(6,0,0) +# endif +# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD6_1) +# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(6,1,0) +# endif +# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD6_2) +# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(6,2,0) +# endif +# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD6_3) +# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(6,3,0) +# endif +# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD6_4) +# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(6,4,0) +# endif +# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD6_5) +# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(6,5,0) +# endif +# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD6_6) +# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(6,6,0) +# endif +# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD6_7) +# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(6,7,0) +# endif +# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD6_8) +# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(6,8,0) +# endif +# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD6_9) +# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(6,9,0) +# endif # if !defined(MSGPACK_OS_BSD_OPEN) # define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER_AVAILABLE # endif diff --git a/include/msgpack/predef/other/endian.h b/include/msgpack/predef/other/endian.h index 3c609fa4..afbda293 100644 --- a/include/msgpack/predef/other/endian.h +++ b/include/msgpack/predef/other/endian.h @@ -148,8 +148,7 @@ information and acquired knowledge: # undef MSGPACK_ENDIAN_BIG_BYTE # define MSGPACK_ENDIAN_BIG_BYTE MSGPACK_VERSION_NUMBER_AVAILABLE # endif -# if MSGPACK_ARCH_AMD64 || \ - MSGPACK_ARCH_IA64 || \ +# if MSGPACK_ARCH_IA64 || \ MSGPACK_ARCH_X86 || \ MSGPACK_ARCH_BLACKFIN # undef MSGPACK_ENDIAN_LITTLE_BYTE diff --git a/include/msgpack/predef/other/workaround.h b/include/msgpack/predef/other/workaround.h new file mode 100644 index 00000000..998c4687 --- /dev/null +++ b/include/msgpack/predef/other/workaround.h @@ -0,0 +1,87 @@ +/* +Copyright Rene Rivera 2017 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_WORKAROUND_H +#define MSGPACK_PREDEF_WORKAROUND_H + +/*` +[heading `MSGPACK_PREDEF_WORKAROUND`] + +`` +MSGPACK_PREDEF_WORKAROUND(symbol,comp,major,minor,patch) +`` + +Usage: + +`` +#if MSGPACK_PREDEF_WORKAROUND(MSGPACK_COMP_CLANG,<,3,0,0) + // Workaround for old clang compilers.. +#endif +`` + +Defines a comparison against two version numbers that depends on the definion +of `MSGPACK_STRICT_CONFIG`. When `MSGPACK_STRICT_CONFIG` is defined this will expand +to a value convertible to `false`. Which has the effect of disabling all code +conditionally guarded by `MSGPACK_PREDEF_WORKAROUND`. When `MSGPACK_STRICT_CONFIG` +is undefine this expand to test the given `symbol` version value with the +`comp` comparison against `MSGPACK_VERSION_NUMBER(major,minor,patch)`. +*/ +#ifdef MSGPACK_STRICT_CONFIG +# define MSGPACK_PREDEF_WORKAROUND(symbol, comp, major, minor, patch) (0) +#else +# include +# define MSGPACK_PREDEF_WORKAROUND(symbol, comp, major, minor, patch) \ + ( (symbol) != (0) ) && \ + ( (symbol) comp (MSGPACK_VERSION_NUMBER( (major) , (minor) , (patch) )) ) +#endif + +/*` +[heading `MSGPACK_PREDEF_TESTED_AT`] + +`` +MSGPACK_PREDEF_TESTED_AT(symbol,major,minor,patch) +`` + +Usage: + +`` +#if MSGPACK_PREDEF_TESTED_AT(MSGPACK_COMP_CLANG,3,5,0) + // Needed for clang, and last checked for 3.5.0. +#endif +`` + +Defines a comparison against two version numbers that depends on the definion +of `MSGPACK_STRICT_CONFIG` and `MSGPACK_DETECT_OUTDATED_WORKAROUNDS`. +When `MSGPACK_STRICT_CONFIG` is defined this will expand to a value convertible +to `false`. Which has the effect of disabling all code +conditionally guarded by `MSGPACK_PREDEF_TESTED_AT`. When `MSGPACK_STRICT_CONFIG` +is undefined this expand to either: + +* A value convertible to `true` when `MSGPACK_DETECT_OUTDATED_WORKAROUNDS` is not + defined. +* A value convertible `true` when the expansion of + `MSGPACK_PREDEF_WORKAROUND(symbol, <=, major, minor, patch)` is `true` and + `MSGPACK_DETECT_OUTDATED_WORKAROUNDS` is defined. +* A compile error when the expansion of + `MSGPACK_PREDEF_WORKAROUND(symbol, >, major, minor, patch)` is true and + `MSGPACK_DETECT_OUTDATED_WORKAROUNDS` is defined. +*/ +#ifdef MSGPACK_STRICT_CONFIG +# define MSGPACK_PREDEF_TESTED_AT(symbol, major, minor, patch) (0) +#else +# ifdef MSGPACK_DETECT_OUTDATED_WORKAROUNDS +# define MSGPACK_PREDEF_TESTED_AT(symbol, major, minor, patch) ( \ + MSGPACK_PREDEF_WORKAROUND(symbol, <=, major, minor, patch) \ + ? 1 \ + : (1%0) ) +# else +# define MSGPACK_PREDEF_TESTED_AT(symbol, major, minor, patch) \ + ( (symbol) >= MSGPACK_VERSION_NUMBER_AVAILABLE ) +# endif +#endif + +#endif diff --git a/include/msgpack/predef/platform.h b/include/msgpack/predef/platform.h index 34255c2b..0176b465 100644 --- a/include/msgpack/predef/platform.h +++ b/include/msgpack/predef/platform.h @@ -11,11 +11,18 @@ http://www.boost.org/LICENSE_1_0.txt) #define MSGPACK_PREDEF_PLATFORM_H #endif +#include #include +#include +#include +#include #include -#include #include -#include +#include +#include +#include +#include // deprecated +#include /*#include */ #endif diff --git a/include/msgpack/predef/platform/cloudabi.h b/include/msgpack/predef/platform/cloudabi.h new file mode 100644 index 00000000..66ece6e0 --- /dev/null +++ b/include/msgpack/predef/platform/cloudabi.h @@ -0,0 +1,43 @@ +/* + Copyright 2017 James E. King, III + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_PLAT_CLOUDABI_H +#define MSGPACK_PREDEF_PLAT_CLOUDABI_H + +#include +#include + +/*` +[heading `MSGPACK_PLAT_CLOUDABI`] + +[@https://github.com/NuxiNL/cloudabi CloudABI] platform. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__CloudABI__`] [__predef_detection__]] + ] + */ + +#define MSGPACK_PLAT_CLOUDABI MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__CloudABI__) +# undef MSGPACK_PLAT_CLOUDABI +# define MSGPACK_PLAT_CLOUDABI MSGPACK_VERSION_NUMBER_AVAILABLE +#endif + +#if MSGPACK_PLAT_CLOUDABI +# define MSGPACK_PLAT_CLOUDABI_AVAILABLE +# include +#endif + +#define MSGPACK_PLAT_CLOUDABI_NAME "CloudABI" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_PLAT_CLOUDABI,MSGPACK_PLAT_CLOUDABI_NAME) diff --git a/include/msgpack/predef/platform/ios.h b/include/msgpack/predef/platform/ios.h new file mode 100644 index 00000000..c3d27f83 --- /dev/null +++ b/include/msgpack/predef/platform/ios.h @@ -0,0 +1,58 @@ +/* +Copyright Ruslan Baratov 2017 +Copyright Rene Rivera 2017 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_PLAT_IOS_H +#define MSGPACK_PREDEF_PLAT_IOS_H + +#include // MSGPACK_OS_IOS +#include // MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +/*` +[heading `MSGPACK_PLAT_IOS_DEVICE`] +[heading `MSGPACK_PLAT_IOS_SIMULATOR`] + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`TARGET_IPHONE_SIMULATOR`] [__predef_detection__]] + ] + */ + +#define MSGPACK_PLAT_IOS_DEVICE MSGPACK_VERSION_NUMBER_NOT_AVAILABLE +#define MSGPACK_PLAT_IOS_SIMULATOR MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +// https://opensource.apple.com/source/CarbonHeaders/CarbonHeaders-18.1/TargetConditionals.h +#if MSGPACK_OS_IOS +# include +# if TARGET_IPHONE_SIMULATOR == 1 +# undef MSGPACK_PLAT_IOS_SIMULATOR +# define MSGPACK_PLAT_IOS_SIMULATOR MSGPACK_VERSION_NUMBER_AVAILABLE +# else +# undef MSGPACK_PLAT_IOS_DEVICE +# define MSGPACK_PLAT_IOS_DEVICE MSGPACK_VERSION_NUMBER_AVAILABLE +# endif +#endif + +#if MSGPACK_PLAT_IOS_SIMULATOR +# define MSGPACK_PLAT_IOS_SIMULATOR_AVAILABLE +# include +#endif + +#if MSGPACK_PLAT_IOS_DEVICE +# define MSGPACK_PLAT_IOS_DEVICE_AVAILABLE +# include +#endif + +#define MSGPACK_PLAT_IOS_SIMULATOR_NAME "iOS Simulator" +#define MSGPACK_PLAT_IOS_DEVICE_NAME "iOS Device" + +#endif // MSGPACK_PREDEF_PLAT_IOS_H + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_PLAT_IOS_SIMULATOR,MSGPACK_PLAT_IOS_SIMULATOR_NAME) +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_PLAT_IOS_DEVICE,MSGPACK_PLAT_IOS_DEVICE_NAME) diff --git a/include/msgpack/predef/platform/mingw.h b/include/msgpack/predef/platform/mingw.h index 213f932c..74f1b548 100644 --- a/include/msgpack/predef/platform/mingw.h +++ b/include/msgpack/predef/platform/mingw.h @@ -5,8 +5,8 @@ Distributed under the Boost Software License, Version 1.0. http://www.boost.org/LICENSE_1_0.txt) */ -#ifndef MSGPACK_PREDEF_COMPILER_MINGW_H -#define MSGPACK_PREDEF_COMPILER_MINGW_H +#ifndef MSGPACK_PREDEF_PLAT_MINGW_H +#define MSGPACK_PREDEF_PLAT_MINGW_H #include #include @@ -14,7 +14,7 @@ http://www.boost.org/LICENSE_1_0.txt) /*` [heading `MSGPACK_PLAT_MINGW`] -[@http://en.wikipedia.org/wiki/MinGW MinGW] platform. +[@http://en.wikipedia.org/wiki/MinGW MinGW] platform, either variety. Version number available as major, minor, and patch. [table @@ -56,7 +56,7 @@ Version number available as major, minor, and patch. # include #endif -#define MSGPACK_PLAT_MINGW_NAME "MinGW" +#define MSGPACK_PLAT_MINGW_NAME "MinGW (any variety)" #endif diff --git a/include/msgpack/predef/platform/mingw32.h b/include/msgpack/predef/platform/mingw32.h new file mode 100644 index 00000000..5d28f828 --- /dev/null +++ b/include/msgpack/predef/platform/mingw32.h @@ -0,0 +1,63 @@ +/* +Copyright Rene Rivera 2008-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_PLAT_MINGW32_H +#define MSGPACK_PREDEF_PLAT_MINGW32_H + +#include +#include + +/*` +[heading `MSGPACK_PLAT_MINGW32`] + +[@http://www.mingw.org/ MinGW] platform. +Version number available as major, minor, and patch. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__MINGW32__`] [__predef_detection__]] + + [[`__MINGW32_VERSION_MAJOR`, `__MINGW32_VERSION_MINOR`] [V.R.0]] + ] + */ + +#define MSGPACK_PLAT_MINGW32 MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__MINGW32__) +# include <_mingw.h> +# if !defined(MSGPACK_PLAT_MINGW32_DETECTION) && (defined(__MINGW32_VERSION_MAJOR) && defined(__MINGW32_VERSION_MINOR)) +# define MSGPACK_PLAT_MINGW32_DETECTION \ + MSGPACK_VERSION_NUMBER(__MINGW32_VERSION_MAJOR,__MINGW32_VERSION_MINOR,0) +# endif +# if !defined(MSGPACK_PLAT_MINGW32_DETECTION) +# define MSGPACK_PLAT_MINGW32_DETECTION MSGPACK_VERSION_NUMBER_AVAILABLE +# endif +#endif + +#ifdef MSGPACK_PLAT_MINGW32_DETECTION +# define MSGPACK_PLAT_MINGW32_AVAILABLE +# if defined(MSGPACK_PREDEF_DETAIL_PLAT_DETECTED) +# define MSGPACK_PLAT_MINGW32_EMULATED MSGPACK_PLAT_MINGW32_DETECTION +# else +# undef MSGPACK_PLAT_MINGW32 +# define MSGPACK_PLAT_MINGW32 MSGPACK_PLAT_MINGW32_DETECTION +# endif +# include +#endif + +#define MSGPACK_PLAT_MINGW32_NAME "MinGW" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_PLAT_MINGW32,MSGPACK_PLAT_MINGW32_NAME) + +#ifdef MSGPACK_PLAT_MINGW32_EMULATED +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_PLAT_MINGW32_EMULATED,MSGPACK_PLAT_MINGW32_NAME) +#endif diff --git a/include/msgpack/predef/platform/mingw64.h b/include/msgpack/predef/platform/mingw64.h new file mode 100644 index 00000000..544b27b3 --- /dev/null +++ b/include/msgpack/predef/platform/mingw64.h @@ -0,0 +1,63 @@ +/* +Copyright Rene Rivera 2008-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_PLAT_MINGW64_H +#define MSGPACK_PREDEF_PLAT_MINGW64_H + +#include +#include + +/*` +[heading `MSGPACK_PLAT_MINGW64`] + +[@https://mingw-w64.org/ MinGW-w64] platform. +Version number available as major, minor, and patch. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__MINGW64__`] [__predef_detection__]] + + [[`__MINGW64_VERSION_MAJOR`, `__MINGW64_VERSION_MINOR`] [V.R.0]] + ] + */ + +#define MSGPACK_PLAT_MINGW64 MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__MINGW64__) +# include <_mingw.h> +# if !defined(MSGPACK_PLAT_MINGW64_DETECTION) && (defined(__MINGW64_VERSION_MAJOR) && defined(__MINGW64_VERSION_MINOR)) +# define MSGPACK_PLAT_MINGW64_DETECTION \ + MSGPACK_VERSION_NUMBER(__MINGW64_VERSION_MAJOR,__MINGW64_VERSION_MINOR,0) +# endif +# if !defined(MSGPACK_PLAT_MINGW64_DETECTION) +# define MSGPACK_PLAT_MINGW64_DETECTION MSGPACK_VERSION_NUMBER_AVAILABLE +# endif +#endif + +#ifdef MSGPACK_PLAT_MINGW64_DETECTION +# define MSGPACK_PLAT_MINGW64_AVAILABLE +# if defined(MSGPACK_PREDEF_DETAIL_PLAT_DETECTED) +# define MSGPACK_PLAT_MINGW64_EMULATED MSGPACK_PLAT_MINGW64_DETECTION +# else +# undef MSGPACK_PLAT_MINGW64 +# define MSGPACK_PLAT_MINGW64 MSGPACK_PLAT_MINGW64_DETECTION +# endif +# include +#endif + +#define MSGPACK_PLAT_MINGW64_NAME "MinGW-w64" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_PLAT_MINGW64,MSGPACK_PLAT_MINGW64_NAME) + +#ifdef MSGPACK_PLAT_MINGW64_EMULATED +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_PLAT_MINGW64_EMULATED,MSGPACK_PLAT_MINGW64_NAME) +#endif diff --git a/include/msgpack/predef/platform/windows_desktop.h b/include/msgpack/predef/platform/windows_desktop.h index 9f0c4f1f..8e69c77c 100644 --- a/include/msgpack/predef/platform/windows_desktop.h +++ b/include/msgpack/predef/platform/windows_desktop.h @@ -9,25 +9,31 @@ http://www.boost.org/LICENSE_1_0.txt) #ifndef MSGPACK_PREDEF_PLAT_WINDOWS_DESKTOP_H #define MSGPACK_PREDEF_PLAT_WINDOWS_DESKTOP_H -#include #include #include +#include +#include /*` [heading `MSGPACK_PLAT_WINDOWS_DESKTOP`] +[@https://docs.microsoft.com/en-us/windows/uwp/get-started/universal-application-platform-guide UWP] +for Windows Desktop development. Also available if the Platform SDK is too +old to support UWP. + [table [[__predef_symbol__] [__predef_version__]] - [[`!WINAPI_FAMILY`] [__predef_detection__]] [[`WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP`] [__predef_detection__]] + [[`!MSGPACK_PLAT_WINDOWS_UWP`] [__predef_detection__]] ] */ #define MSGPACK_PLAT_WINDOWS_DESKTOP MSGPACK_VERSION_NUMBER_NOT_AVAILABLE #if MSGPACK_OS_WINDOWS && \ - ( !defined(WINAPI_FAMILY) || (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP) ) + ((defined(WINAPI_FAMILY_DESKTOP_APP) && WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP) || \ + !MSGPACK_PLAT_WINDOWS_UWP) # undef MSGPACK_PLAT_WINDOWS_DESKTOP # define MSGPACK_PLAT_WINDOWS_DESKTOP MSGPACK_VERSION_NUMBER_AVAILABLE #endif diff --git a/include/msgpack/predef/platform/windows_phone.h b/include/msgpack/predef/platform/windows_phone.h index a224f69c..8ac423fc 100644 --- a/include/msgpack/predef/platform/windows_phone.h +++ b/include/msgpack/predef/platform/windows_phone.h @@ -9,13 +9,17 @@ http://www.boost.org/LICENSE_1_0.txt) #ifndef MSGPACK_PREDEF_PLAT_WINDOWS_PHONE_H #define MSGPACK_PREDEF_PLAT_WINDOWS_PHONE_H -#include #include #include +#include +#include /*` [heading `MSGPACK_PLAT_WINDOWS_PHONE`] +[@https://docs.microsoft.com/en-us/windows/uwp/get-started/universal-application-platform-guide UWP] +for Windows Phone development. + [table [[__predef_symbol__] [__predef_version__]] @@ -25,7 +29,8 @@ http://www.boost.org/LICENSE_1_0.txt) #define MSGPACK_PLAT_WINDOWS_PHONE MSGPACK_VERSION_NUMBER_NOT_AVAILABLE -#if MSGPACK_OS_WINDOWS && defined(WINAPI_FAMILY) && WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP +#if MSGPACK_OS_WINDOWS && \ + defined(WINAPI_FAMILY_PHONE_APP) && WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP # undef MSGPACK_PLAT_WINDOWS_PHONE # define MSGPACK_PLAT_WINDOWS_PHONE MSGPACK_VERSION_NUMBER_AVAILABLE #endif diff --git a/include/msgpack/predef/platform/windows_runtime.h b/include/msgpack/predef/platform/windows_runtime.h index 759b2f86..db7e76b4 100644 --- a/include/msgpack/predef/platform/windows_runtime.h +++ b/include/msgpack/predef/platform/windows_runtime.h @@ -9,25 +9,33 @@ http://www.boost.org/LICENSE_1_0.txt) #ifndef MSGPACK_PREDEF_PLAT_WINDOWS_RUNTIME_H #define MSGPACK_PREDEF_PLAT_WINDOWS_RUNTIME_H -#include #include #include +#include +#include +#include /*` [heading `MSGPACK_PLAT_WINDOWS_RUNTIME`] +Deprecated. + +[@https://docs.microsoft.com/en-us/windows/uwp/get-started/universal-application-platform-guide UWP] +for Windows Phone or Store development. This does not align to the existing development model for +UWP and is deprecated. Use one of the other `MSGPACK_PLAT_WINDOWS_*`definitions instead. + [table [[__predef_symbol__] [__predef_version__]] - [[`WINAPI_FAMILY == WINAPI_FAMILY_APP`] [__predef_detection__]] - [[`WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP`] [__predef_detection__]] + [[`MSGPACK_PLAT_WINDOWS_PHONE`] [__predef_detection__]] + [[`MSGPACK_PLAT_WINDOWS_STORE`] [__predef_detection__]] ] */ #define MSGPACK_PLAT_WINDOWS_RUNTIME MSGPACK_VERSION_NUMBER_NOT_AVAILABLE -#if MSGPACK_OS_WINDOWS && defined(WINAPI_FAMILY) && \ - ( WINAPI_FAMILY == WINAPI_FAMILY_APP || WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP ) +#if MSGPACK_OS_WINDOWS && \ + (MSGPACK_PLAT_WINDOWS_STORE || MSGPACK_PLAT_WINDOWS_PHONE) # undef MSGPACK_PLAT_WINDOWS_RUNTIME # define MSGPACK_PLAT_WINDOWS_RUNTIME MSGPACK_VERSION_NUMBER_AVAILABLE #endif diff --git a/include/msgpack/predef/platform/windows_server.h b/include/msgpack/predef/platform/windows_server.h new file mode 100644 index 00000000..3506155e --- /dev/null +++ b/include/msgpack/predef/platform/windows_server.h @@ -0,0 +1,47 @@ +/* +Copyright James E. King III, 2017 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_PLAT_WINDOWS_SERVER_H +#define MSGPACK_PREDEF_PLAT_WINDOWS_SERVER_H + +#include +#include +#include +#include + +/*` +[heading `MSGPACK_PLAT_WINDOWS_SERVER`] + +[@https://docs.microsoft.com/en-us/windows/uwp/get-started/universal-application-platform-guide UWP] +for Windows Server development. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`WINAPI_FAMILY == WINAPI_FAMILY_SERVER`] [__predef_detection__]] + ] + */ + +#define MSGPACK_PLAT_WINDOWS_SERVER MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if MSGPACK_OS_WINDOWS && \ + defined(WINAPI_FAMILY_SERVER) && WINAPI_FAMILY == WINAPI_FAMILY_SERVER +# undef MSGPACK_PLAT_WINDOWS_SERVER +# define MSGPACK_PLAT_WINDOWS_SERVER MSGPACK_VERSION_NUMBER_AVAILABLE +#endif + +#if MSGPACK_PLAT_WINDOWS_SERVER +# define MSGPACK_PLAT_WINDOWS_SERVER_AVAILABLE +# include +#endif + +#define MSGPACK_PLAT_WINDOWS_SERVER_NAME "Windows Server" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_PLAT_WINDOWS_SERVER,MSGPACK_PLAT_WINDOWS_SERVER_NAME) diff --git a/include/msgpack/predef/platform/windows_store.h b/include/msgpack/predef/platform/windows_store.h index c538c9b3..d9faf1a5 100644 --- a/include/msgpack/predef/platform/windows_store.h +++ b/include/msgpack/predef/platform/windows_store.h @@ -9,23 +9,30 @@ http://www.boost.org/LICENSE_1_0.txt) #ifndef MSGPACK_PREDEF_PLAT_WINDOWS_STORE_H #define MSGPACK_PREDEF_PLAT_WINDOWS_STORE_H -#include #include #include +#include +#include /*` [heading `MSGPACK_PLAT_WINDOWS_STORE`] +[@https://docs.microsoft.com/en-us/windows/uwp/get-started/universal-application-platform-guide UWP] +for Windows Store development. + [table [[__predef_symbol__] [__predef_version__]] - [[`WINAPI_FAMILY == WINAPI_FAMILY_APP`] [__predef_detection__]] - ] + [[`WINAPI_FAMILY == WINAPI_FAMILY_PC_APP`] [__predef_detection__]] + [[`WINAPI_FAMILY == WINAPI_FAMILY_APP` (deprecated)] [__predef_detection__]] +] */ #define MSGPACK_PLAT_WINDOWS_STORE MSGPACK_VERSION_NUMBER_NOT_AVAILABLE -#if MSGPACK_OS_WINDOWS && defined(WINAPI_FAMILY) && WINAPI_FAMILY == WINAPI_FAMILY_APP +#if MSGPACK_OS_WINDOWS && \ + ((defined(WINAPI_FAMILY_PC_APP) && WINAPI_FAMILY == WINAPI_FAMILY_PC_APP) || \ + (defined(WINAPI_FAMILY_APP) && WINAPI_FAMILY == WINAPI_FAMILY_APP)) # undef MSGPACK_PLAT_WINDOWS_STORE # define MSGPACK_PLAT_WINDOWS_STORE MSGPACK_VERSION_NUMBER_AVAILABLE #endif diff --git a/include/msgpack/predef/platform/windows_system.h b/include/msgpack/predef/platform/windows_system.h new file mode 100644 index 00000000..c97b0e26 --- /dev/null +++ b/include/msgpack/predef/platform/windows_system.h @@ -0,0 +1,47 @@ +/* +Copyright James E. King III, 2017 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_PLAT_WINDOWS_SYSTEM_H +#define MSGPACK_PREDEF_PLAT_WINDOWS_SYSTEM_H + +#include +#include +#include +#include + +/*` +[heading `MSGPACK_PLAT_WINDOWS_SYSTEM`] + +[@https://docs.microsoft.com/en-us/windows/uwp/get-started/universal-application-platform-guide UWP] +for Windows System development. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`WINAPI_FAMILY == WINAPI_FAMILY_SYSTEM`] [__predef_detection__]] + ] + */ + +#define MSGPACK_PLAT_WINDOWS_SYSTEM MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if MSGPACK_OS_WINDOWS && \ + defined(WINAPI_FAMILY_SYSTEM) && WINAPI_FAMILY == WINAPI_FAMILY_SYSTEM +# undef MSGPACK_PLAT_WINDOWS_SYSTEM +# define MSGPACK_PLAT_WINDOWS_SYSTEM MSGPACK_VERSION_NUMBER_AVAILABLE +#endif + +#if MSGPACK_PLAT_WINDOWS_SYSTEM +# define MSGPACK_PLAT_WINDOWS_SYSTEM_AVAILABLE +# include +#endif + +#define MSGPACK_PLAT_WINDOWS_SYSTEM_NAME "Windows Drivers and Tools" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_PLAT_WINDOWS_SYSTEM,MSGPACK_PLAT_WINDOWS_SYSTEM_NAME) diff --git a/include/msgpack/predef/platform/windows_uwp.h b/include/msgpack/predef/platform/windows_uwp.h new file mode 100644 index 00000000..abf1916a --- /dev/null +++ b/include/msgpack/predef/platform/windows_uwp.h @@ -0,0 +1,60 @@ +/* +Copyright James E. King III, 2017 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_PLAT_WINDOWS_UWP_H +#define MSGPACK_PREDEF_PLAT_WINDOWS_UWP_H + +#include +#include +#include + +/*` +[heading `MSGPACK_PLAT_WINDOWS_UWP`] + +[@http://docs.microsoft.com/windows/uwp/ Universal Windows Platform] +is available if the current development environment is capable of targeting +UWP development. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__MINGW64_VERSION_MAJOR` from `_mingw.h`] [`>= 3`]] + [[`VER_PRODUCTBUILD` from `ntverp.h`] [`>= 9200`]] +] +*/ + +#define MSGPACK_PLAT_WINDOWS_UWP MSGPACK_VERSION_NUMBER_NOT_AVAILABLE +#define MSGPACK_PLAT_WINDOWS_SDK_VERSION MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if MSGPACK_OS_WINDOWS +// MinGW (32-bit) has no ntverp.h header +#if !defined(__MINGW32__) +# include +# undef MSGPACK_PLAT_WINDOWS_SDK_VERSION +# define MSGPACK_PLAT_WINDOWS_SDK_VERSION MSGPACK_VERSION_NUMBER(0, 0, VER_PRODUCTBUILD) +#endif + +// 9200 is Windows SDK 8.0 from ntverp.h which introduced family support +#if ((MSGPACK_PLAT_WINDOWS_SDK_VERSION >= MSGPACK_VERSION_NUMBER(0, 0, 9200)) || \ + (defined(__MINGW64__) && __MINGW64_VERSION_MAJOR >= 3)) +# undef MSGPACK_PLAT_WINDOWS_UWP +# define MSGPACK_PLAT_WINDOWS_UWP MSGPACK_VERSION_NUMBER_AVAILABLE +#endif +#endif + +#if MSGPACK_PLAT_WINDOWS_UWP +# define MSGPACK_PLAT_WINDOWS_UWP_AVAILABLE +# include +# include // Windows SDK +#endif + +#define MSGPACK_PLAT_WINDOWS_UWP_NAME "Universal Windows Platform" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_PLAT_WINDOWS_UWP, MSGPACK_PLAT_WINDOWS_UWP_NAME) diff --git a/include/msgpack/predef/version.h b/include/msgpack/predef/version.h index 12a33822..adacf28f 100644 --- a/include/msgpack/predef/version.h +++ b/include/msgpack/predef/version.h @@ -10,6 +10,6 @@ http://www.boost.org/LICENSE_1_0.txt) #include -#define MSGPACK_PREDEF_VERSION MSGPACK_VERSION_NUMBER(1,4,1) +#define MSGPACK_PREDEF_VERSION MSGPACK_VERSION_NUMBER(1,8,0) #endif diff --git a/include/msgpack/predef/version_number.h b/include/msgpack/predef/version_number.h index be8ff552..593afab0 100644 --- a/include/msgpack/predef/version_number.h +++ b/include/msgpack/predef/version_number.h @@ -1,5 +1,5 @@ /* -Copyright Rene Rivera 2005, 2008-2013 +Copyright Rene Rivera 2005-2016 Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -50,4 +50,23 @@ Defines standard version numbers, with these properties: #define MSGPACK_VERSION_NUMBER_NOT_AVAILABLE \ MSGPACK_VERSION_NUMBER_ZERO +/*` +`` +MSGPACK_VERSION_NUMBER_MAJOR(N), MSGPACK_VERSION_NUMBER_MINOR(N), MSGPACK_VERSION_NUMBER_PATCH(N) +`` + +The macros extract the major, minor, and patch portion from a well formed +version number resulting in a preprocessor expression in the range of +\[0,99\] or \[0,99999\] for the major and minor, or patch numbers +respectively. +*/ +#define MSGPACK_VERSION_NUMBER_MAJOR(N) \ + ( ((N)/10000000)%100 ) + +#define MSGPACK_VERSION_NUMBER_MINOR(N) \ + ( ((N)/100000)%100 ) + +#define MSGPACK_VERSION_NUMBER_PATCH(N) \ + ( (N)%100000 ) + #endif diff --git a/include/msgpack/preprocessor/cat.hpp b/include/msgpack/preprocessor/cat.hpp index a7b29262..775a7cd4 100644 --- a/include/msgpack/preprocessor/cat.hpp +++ b/include/msgpack/preprocessor/cat.hpp @@ -25,7 +25,7 @@ # define MSGPACK_PP_CAT_OO(par) MSGPACK_PP_CAT_I ## par # endif # -# if ~MSGPACK_PP_CONFIG_FLAGS() & MSGPACK_PP_CONFIG_MSVC() +# if (~MSGPACK_PP_CONFIG_FLAGS() & MSGPACK_PP_CONFIG_MSVC()) || (defined(__INTEL_COMPILER) && __INTEL_COMPILER >= 1700) # define MSGPACK_PP_CAT_I(a, b) a ## b # else # define MSGPACK_PP_CAT_I(a, b) MSGPACK_PP_CAT_II(~, a ## b) diff --git a/include/msgpack/preprocessor/config/config.hpp b/include/msgpack/preprocessor/config/config.hpp index 7ae4b15b..51c43cbe 100644 --- a/include/msgpack/preprocessor/config/config.hpp +++ b/include/msgpack/preprocessor/config/config.hpp @@ -25,18 +25,16 @@ # define MSGPACK_PP_CONFIG_DMC() 0x0040 # # ifndef MSGPACK_PP_CONFIG_FLAGS -# if defined(__GCCXML__) -# define MSGPACK_PP_CONFIG_FLAGS() (MSGPACK_PP_CONFIG_STRICT()) -# elif defined(__WAVE__) -# define MSGPACK_PP_CONFIG_FLAGS() (MSGPACK_PP_CONFIG_STRICT()) -# elif defined(__MWERKS__) && __MWERKS__ >= 0x3200 +# if defined(__GCCXML__) || defined(__WAVE__) || defined(__MWERKS__) && __MWERKS__ >= 0x3200 # define MSGPACK_PP_CONFIG_FLAGS() (MSGPACK_PP_CONFIG_STRICT()) # elif defined(__EDG__) || defined(__EDG_VERSION__) -# if defined(_MSC_VER) && (defined(__INTELLISENSE__) || __EDG_VERSION__ >= 308) +# if defined(_MSC_VER) && !defined(__clang__) && (defined(__INTELLISENSE__) || __EDG_VERSION__ >= 308) # define MSGPACK_PP_CONFIG_FLAGS() (MSGPACK_PP_CONFIG_MSVC()) # else # define MSGPACK_PP_CONFIG_FLAGS() (MSGPACK_PP_CONFIG_EDG() | MSGPACK_PP_CONFIG_STRICT()) # endif +# elif defined(_MSC_VER) && defined(__clang__) +# define MSGPACK_PP_CONFIG_FLAGS() (MSGPACK_PP_CONFIG_STRICT()) # elif defined(__MWERKS__) # define MSGPACK_PP_CONFIG_FLAGS() (MSGPACK_PP_CONFIG_MWCC()) # elif defined(__DMC__) @@ -45,7 +43,7 @@ # define MSGPACK_PP_CONFIG_FLAGS() (MSGPACK_PP_CONFIG_STRICT()) # elif defined(__BORLANDC__) || defined(__IBMC__) || defined(__IBMCPP__) || defined(__SUNPRO_CC) # define MSGPACK_PP_CONFIG_FLAGS() (MSGPACK_PP_CONFIG_BCC()) -# elif defined(_MSC_VER) && !defined(__clang__) +# elif defined(_MSC_VER) # define MSGPACK_PP_CONFIG_FLAGS() (MSGPACK_PP_CONFIG_MSVC()) # else # define MSGPACK_PP_CONFIG_FLAGS() (MSGPACK_PP_CONFIG_STRICT()) @@ -73,10 +71,14 @@ # define MSGPACK_PP_VARIADICS_MSVC 0 # if !defined MSGPACK_PP_VARIADICS # /* variadic support explicitly disabled for all untested compilers */ -# if defined __GCCXML__ || defined __CUDACC__ || 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 __IBMCPP__ || defined __PGI +# 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 # define MSGPACK_PP_VARIADICS 0 -# /* VC++ (C/C++) */ -# elif defined _MSC_VER && _MSC_VER >= 1400 && (!defined __EDG__ || defined(__INTELLISENSE__)) && !defined __clang__ +# elif defined(__CUDACC__) +# define MSGPACK_PP_VARIADICS 1 +# elif defined(_MSC_VER) && defined(__clang__) +# define MSGPACK_PP_VARIADICS 1 +# /* VC++ (C/C++) and Intel C++ Compiler >= 17.0 with MSVC */ +# elif defined _MSC_VER && _MSC_VER >= 1400 && (!defined __EDG__ || defined(__INTELLISENSE__) || defined(__INTEL_COMPILER) && __INTEL_COMPILER >= 1700) # define MSGPACK_PP_VARIADICS 1 # undef MSGPACK_PP_VARIADICS_MSVC # define MSGPACK_PP_VARIADICS_MSVC 1 @@ -92,7 +94,7 @@ # elif !MSGPACK_PP_VARIADICS + 1 < 2 # undef MSGPACK_PP_VARIADICS # define MSGPACK_PP_VARIADICS 1 -# if defined _MSC_VER && _MSC_VER >= 1400 && (defined(__INTELLISENSE__) || !(defined __EDG__ || defined __GCCXML__ || defined __CUDACC__ || defined __PATHSCALE__ || defined __clang__ || defined __DMC__ || defined __CODEGEARC__ || defined __BORLANDC__ || defined __MWERKS__ || defined __SUNPRO_CC || defined __HP_aCC || defined __MRC__ || defined __SC__ || defined __IBMCPP__ || defined __PGI)) +# if defined _MSC_VER && _MSC_VER >= 1400 && !defined(__clang__) && (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)) # undef MSGPACK_PP_VARIADICS_MSVC # define MSGPACK_PP_VARIADICS_MSVC 1 # endif diff --git a/include/msgpack/preprocessor/seq/detail/binary_transform.hpp b/include/msgpack/preprocessor/seq/detail/binary_transform.hpp index cc4e6fd7..e197ff27 100644 --- a/include/msgpack/preprocessor/seq/detail/binary_transform.hpp +++ b/include/msgpack/preprocessor/seq/detail/binary_transform.hpp @@ -30,14 +30,13 @@ # endif # if MSGPACK_PP_VARIADICS # if MSGPACK_PP_VARIADICS_MSVC -# define MSGPACK_PP_SEQ_BINARY_TRANSFORM_GET_REM(...) \ - MSGPACK_PP_VARIADIC_IS_SINGLE_RETURN(MSGPACK_PP_REM_CAT,MSGPACK_PP_REM,__VA_ARGS__) \ - /**/ +# define MSGPACK_PP_SEQ_BINARY_TRANSFORM_REM(data) data +# define MSGPACK_PP_SEQ_BINARY_TRANSFORM_A(...) (MSGPACK_PP_SEQ_BINARY_TRANSFORM_REM, __VA_ARGS__)() MSGPACK_PP_SEQ_BINARY_TRANSFORM_B +# define MSGPACK_PP_SEQ_BINARY_TRANSFORM_B(...) (MSGPACK_PP_SEQ_BINARY_TRANSFORM_REM, __VA_ARGS__)() MSGPACK_PP_SEQ_BINARY_TRANSFORM_A # else -# define MSGPACK_PP_SEQ_BINARY_TRANSFORM_GET_REM(...) MSGPACK_PP_REM +# define MSGPACK_PP_SEQ_BINARY_TRANSFORM_A(...) (MSGPACK_PP_REM, __VA_ARGS__)() MSGPACK_PP_SEQ_BINARY_TRANSFORM_B +# define MSGPACK_PP_SEQ_BINARY_TRANSFORM_B(...) (MSGPACK_PP_REM, __VA_ARGS__)() MSGPACK_PP_SEQ_BINARY_TRANSFORM_A # endif -# define MSGPACK_PP_SEQ_BINARY_TRANSFORM_A(...) (MSGPACK_PP_SEQ_BINARY_TRANSFORM_GET_REM(__VA_ARGS__), __VA_ARGS__)() MSGPACK_PP_SEQ_BINARY_TRANSFORM_B -# define MSGPACK_PP_SEQ_BINARY_TRANSFORM_B(...) (MSGPACK_PP_SEQ_BINARY_TRANSFORM_GET_REM(__VA_ARGS__), __VA_ARGS__)() MSGPACK_PP_SEQ_BINARY_TRANSFORM_A # else # define MSGPACK_PP_SEQ_BINARY_TRANSFORM_A(e) (MSGPACK_PP_REM, e)() MSGPACK_PP_SEQ_BINARY_TRANSFORM_B # define MSGPACK_PP_SEQ_BINARY_TRANSFORM_B(e) (MSGPACK_PP_REM, e)() MSGPACK_PP_SEQ_BINARY_TRANSFORM_A diff --git a/include/msgpack/preprocessor/seq/detail/to_list_msvc.hpp b/include/msgpack/preprocessor/seq/detail/to_list_msvc.hpp new file mode 100644 index 00000000..942db3ad --- /dev/null +++ b/include/msgpack/preprocessor/seq/detail/to_list_msvc.hpp @@ -0,0 +1,55 @@ +# /* ************************************************************************** +# * * +# * (C) Copyright Edward Diener 2016. * +# * Distributed under the Boost Software License, Version 1.0. (See * +# * accompanying file LICENSE_1_0.txt or copy at * +# * http://www.boost.org/LICENSE_1_0.txt) * +# * * +# ************************************************************************** */ +# +# /* See http://www.boost.org for most recent version. */ +# +# ifndef MSGPACK_PREPROCESSOR_SEQ_DETAIL_TO_LIST_MSVC_HPP +# define MSGPACK_PREPROCESSOR_SEQ_DETAIL_TO_LIST_MSVC_HPP +# +# include +# +# if MSGPACK_PP_CONFIG_FLAGS() & MSGPACK_PP_CONFIG_MSVC() +# +# include +# include +# include +# include +# +# define MSGPACK_PP_SEQ_DETAIL_TO_LIST_MSVC_STATE_RESULT(state) \ + MSGPACK_PP_TUPLE_ELEM(2, 0, state) \ +/**/ +# define MSGPACK_PP_SEQ_DETAIL_TO_LIST_MSVC_STATE_SIZE(state) \ + MSGPACK_PP_TUPLE_ELEM(2, 1, state) \ +/**/ +# define MSGPACK_PP_SEQ_DETAIL_TO_LIST_MSVC_PRED(d,state) \ + MSGPACK_PP_SEQ_DETAIL_TO_LIST_MSVC_STATE_SIZE(state) \ +/**/ +# define MSGPACK_PP_SEQ_DETAIL_TO_LIST_MSVC_OP(d,state) \ + ( \ + MSGPACK_PP_CAT(MSGPACK_PP_SEQ_DETAIL_TO_LIST_MSVC_STATE_RESULT(state),), \ + MSGPACK_PP_DEC(MSGPACK_PP_SEQ_DETAIL_TO_LIST_MSVC_STATE_SIZE(state)) \ + ) \ +/**/ +# +# /* MSGPACK_PP_SEQ_DETAIL_TO_LIST_MSVC */ +# +# define MSGPACK_PP_SEQ_DETAIL_TO_LIST_MSVC(result,seqsize) \ + MSGPACK_PP_SEQ_DETAIL_TO_LIST_MSVC_STATE_RESULT \ + ( \ + MSGPACK_PP_WHILE \ + ( \ + MSGPACK_PP_SEQ_DETAIL_TO_LIST_MSVC_PRED, \ + MSGPACK_PP_SEQ_DETAIL_TO_LIST_MSVC_OP, \ + (result,seqsize) \ + ) \ + ) \ +/**/ +# endif // MSGPACK_PP_CONFIG_FLAGS() & MSGPACK_PP_CONFIG_MSVC() +# +# endif // MSGPACK_PREPROCESSOR_SEQ_DETAIL_TO_LIST_MSVC_HPP diff --git a/include/msgpack/preprocessor/seq/to_list.hpp b/include/msgpack/preprocessor/seq/to_list.hpp index e40866be..21370781 100644 --- a/include/msgpack/preprocessor/seq/to_list.hpp +++ b/include/msgpack/preprocessor/seq/to_list.hpp @@ -19,7 +19,19 @@ # # /* MSGPACK_PP_SEQ_TO_LIST */ # +# if MSGPACK_PP_CONFIG_FLAGS() & MSGPACK_PP_CONFIG_MSVC() +# include +# include +# define MSGPACK_PP_SEQ_TO_LIST(seq) \ + MSGPACK_PP_SEQ_DETAIL_TO_LIST_MSVC \ + ( \ + MSGPACK_PP_SEQ_TO_LIST_I(MSGPACK_PP_SEQ_BINARY_TRANSFORM(seq)), \ + MSGPACK_PP_SEQ_SIZE(seq) \ + ) \ +/**/ +# else # define MSGPACK_PP_SEQ_TO_LIST(seq) MSGPACK_PP_SEQ_TO_LIST_I(MSGPACK_PP_SEQ_BINARY_TRANSFORM(seq)) +# endif # define MSGPACK_PP_SEQ_TO_LIST_I(bseq) MSGPACK_PP_SEQ_TO_LIST_A bseq MSGPACK_PP_NIL MSGPACK_PP_SEQ_TO_LIST_B bseq # define MSGPACK_PP_SEQ_TO_LIST_A(m, e) m(MSGPACK_PP_LPAREN() e MSGPACK_PP_COMMA() MSGPACK_PP_SEQ_TO_LIST_A_ID) # define MSGPACK_PP_SEQ_TO_LIST_A_ID() MSGPACK_PP_SEQ_TO_LIST_A