Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-15 08:55:00

0001 // Copyright (c) 2017-2025, University of Cincinnati, developed by Henry Schreiner
0002 // under NSF AWARD 1414736 and by the respective contributors.
0003 // All rights reserved.
0004 //
0005 // SPDX-License-Identifier: BSD-3-Clause
0006 
0007 #pragma once
0008 
0009 // IWYU pragma: private, include "CLI/CLI.hpp"
0010 
0011 // [CLI11:macros_hpp:verbatim]
0012 
0013 // The following version macro is very similar to the one in pybind11
0014 #if !(defined(_MSC_VER) && __cplusplus == 199711L) && !defined(__INTEL_COMPILER)
0015 #if __cplusplus >= 201402L
0016 #define CLI11_CPP14
0017 #if __cplusplus >= 201703L
0018 #define CLI11_CPP17
0019 #if __cplusplus > 201703L
0020 #define CLI11_CPP20
0021 #if __cplusplus > 202002L
0022 #define CLI11_CPP23
0023 #if __cplusplus > 202302L
0024 #define CLI11_CPP26
0025 #endif
0026 #endif
0027 #endif
0028 #endif
0029 #endif
0030 #elif defined(_MSC_VER) && __cplusplus == 199711L
0031 // MSVC sets _MSVC_LANG rather than __cplusplus (supposedly until the standard was fully implemented)
0032 // Unless you use the /Zc:__cplusplus flag on Visual Studio 2017 15.7 Preview 3 or newer
0033 #if _MSVC_LANG >= 201402L
0034 #define CLI11_CPP14
0035 #if _MSVC_LANG > 201402L && _MSC_VER >= 1910
0036 #define CLI11_CPP17
0037 #if _MSVC_LANG > 201703L && _MSC_VER >= 1910
0038 #define CLI11_CPP20
0039 #if _MSVC_LANG > 202002L && _MSC_VER >= 1922
0040 #define CLI11_CPP23
0041 #endif
0042 #endif
0043 #endif
0044 #endif
0045 #endif
0046 
0047 #if defined(CLI11_CPP14)
0048 #define CLI11_DEPRECATED(reason) [[deprecated(reason)]]
0049 #elif defined(_MSC_VER)
0050 #define CLI11_DEPRECATED(reason) __declspec(deprecated(reason))
0051 #else
0052 #define CLI11_DEPRECATED(reason) __attribute__((deprecated(reason)))
0053 #endif
0054 
0055 // GCC < 10 doesn't ignore this in unevaluated contexts
0056 #if !defined(CLI11_CPP17) ||                                                                                           \
0057     (defined(__GNUC__) && !defined(__llvm__) && !defined(__INTEL_COMPILER) && __GNUC__ < 10 && __GNUC__ > 4)
0058 #define CLI11_NODISCARD
0059 #else
0060 #define CLI11_NODISCARD [[nodiscard]]
0061 #endif
0062 
0063 /** detection of rtti */
0064 #ifndef CLI11_USE_STATIC_RTTI
0065 #if (defined(_HAS_STATIC_RTTI) && _HAS_STATIC_RTTI)
0066 #define CLI11_USE_STATIC_RTTI 1
0067 #elif defined(__cpp_rtti)
0068 #if (defined(_CPPRTTI) && _CPPRTTI == 0)
0069 #define CLI11_USE_STATIC_RTTI 1
0070 #else
0071 #define CLI11_USE_STATIC_RTTI 0
0072 #endif
0073 #elif (defined(__GCC_RTTI) && __GXX_RTTI)
0074 #define CLI11_USE_STATIC_RTTI 0
0075 #else
0076 #define CLI11_USE_STATIC_RTTI 1
0077 #endif
0078 #endif
0079 
0080 /** <filesystem> availability */
0081 #if defined CLI11_CPP17 && defined __has_include && !defined CLI11_HAS_FILESYSTEM
0082 #if __has_include(<filesystem>)
0083 // Filesystem cannot be used if targeting macOS < 10.15
0084 #if defined __MAC_OS_X_VERSION_MIN_REQUIRED && __MAC_OS_X_VERSION_MIN_REQUIRED < 101500
0085 #define CLI11_HAS_FILESYSTEM 0
0086 #elif defined(__wasi__)
0087 // As of wasi-sdk-14, filesystem is not implemented
0088 #define CLI11_HAS_FILESYSTEM 0
0089 #else
0090 #include <filesystem>
0091 #if defined __cpp_lib_filesystem && __cpp_lib_filesystem >= 201703
0092 #if defined _GLIBCXX_RELEASE && _GLIBCXX_RELEASE >= 9
0093 #define CLI11_HAS_FILESYSTEM 1
0094 #elif defined(__GLIBCXX__)
0095 // if we are using gcc and Version <9 default to no filesystem
0096 #define CLI11_HAS_FILESYSTEM 0
0097 #else
0098 #define CLI11_HAS_FILESYSTEM 1
0099 #endif
0100 #else
0101 #define CLI11_HAS_FILESYSTEM 0
0102 #endif
0103 #endif
0104 #endif
0105 #endif
0106 
0107 /** <codecvt> availability */
0108 #if !defined(CLI11_CPP26) && !defined(CLI11_HAS_CODECVT)
0109 #if defined(__GNUC__) && !defined(__llvm__) && !defined(__INTEL_COMPILER) && __GNUC__ < 5
0110 #define CLI11_HAS_CODECVT 0
0111 #else
0112 #define CLI11_HAS_CODECVT 1
0113 #include <codecvt>
0114 #endif
0115 #else
0116 #if defined(CLI11_HAS_CODECVT)
0117 #if CLI11_HAS_CODECVT > 0
0118 #include <codecvt>
0119 #endif
0120 #else
0121 #define CLI11_HAS_CODECVT 0
0122 #endif
0123 #endif
0124 
0125 /** disable deprecations */
0126 #if defined(__GNUC__)  // GCC or clang
0127 #define CLI11_DIAGNOSTIC_PUSH _Pragma("GCC diagnostic push")
0128 #define CLI11_DIAGNOSTIC_POP _Pragma("GCC diagnostic pop")
0129 
0130 #define CLI11_DIAGNOSTIC_IGNORE_DEPRECATED _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
0131 
0132 #elif defined(_MSC_VER)
0133 #define CLI11_DIAGNOSTIC_PUSH __pragma(warning(push))
0134 #define CLI11_DIAGNOSTIC_POP __pragma(warning(pop))
0135 
0136 #define CLI11_DIAGNOSTIC_IGNORE_DEPRECATED __pragma(warning(disable : 4996))
0137 
0138 #else
0139 #define CLI11_DIAGNOSTIC_PUSH
0140 #define CLI11_DIAGNOSTIC_POP
0141 
0142 #define CLI11_DIAGNOSTIC_IGNORE_DEPRECATED
0143 
0144 #endif
0145 
0146 /** Inline macro **/
0147 #ifdef CLI11_COMPILE
0148 #define CLI11_INLINE
0149 #else
0150 #define CLI11_INLINE inline
0151 #endif
0152 // [CLI11:macros_hpp:end]