Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-07-05 08:51:42

0001 // Copyright (c) 2017-2024, 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 #endif
0022 #endif
0023 #endif
0024 #elif defined(_MSC_VER) && __cplusplus == 199711L
0025 // MSVC sets _MSVC_LANG rather than __cplusplus (supposedly until the standard is fully implemented)
0026 // Unless you use the /Zc:__cplusplus flag on Visual Studio 2017 15.7 Preview 3 or newer
0027 #if _MSVC_LANG >= 201402L
0028 #define CLI11_CPP14
0029 #if _MSVC_LANG > 201402L && _MSC_VER >= 1910
0030 #define CLI11_CPP17
0031 #if _MSVC_LANG > 201703L && _MSC_VER >= 1910
0032 #define CLI11_CPP20
0033 #endif
0034 #endif
0035 #endif
0036 #endif
0037 
0038 #if defined(CLI11_CPP14)
0039 #define CLI11_DEPRECATED(reason) [[deprecated(reason)]]
0040 #elif defined(_MSC_VER)
0041 #define CLI11_DEPRECATED(reason) __declspec(deprecated(reason))
0042 #else
0043 #define CLI11_DEPRECATED(reason) __attribute__((deprecated(reason)))
0044 #endif
0045 
0046 // GCC < 10 doesn't ignore this in unevaluated contexts
0047 #if !defined(CLI11_CPP17) ||                                                                                           \
0048     (defined(__GNUC__) && !defined(__llvm__) && !defined(__INTEL_COMPILER) && __GNUC__ < 10 && __GNUC__ > 4)
0049 #define CLI11_NODISCARD
0050 #else
0051 #define CLI11_NODISCARD [[nodiscard]]
0052 #endif
0053 
0054 /** detection of rtti */
0055 #ifndef CLI11_USE_STATIC_RTTI
0056 #if(defined(_HAS_STATIC_RTTI) && _HAS_STATIC_RTTI)
0057 #define CLI11_USE_STATIC_RTTI 1
0058 #elif defined(__cpp_rtti)
0059 #if(defined(_CPPRTTI) && _CPPRTTI == 0)
0060 #define CLI11_USE_STATIC_RTTI 1
0061 #else
0062 #define CLI11_USE_STATIC_RTTI 0
0063 #endif
0064 #elif(defined(__GCC_RTTI) && __GXX_RTTI)
0065 #define CLI11_USE_STATIC_RTTI 0
0066 #else
0067 #define CLI11_USE_STATIC_RTTI 1
0068 #endif
0069 #endif
0070 
0071 /** <filesystem> availability */
0072 #if defined CLI11_CPP17 && defined __has_include && !defined CLI11_HAS_FILESYSTEM
0073 #if __has_include(<filesystem>)
0074 // Filesystem cannot be used if targeting macOS < 10.15
0075 #if defined __MAC_OS_X_VERSION_MIN_REQUIRED && __MAC_OS_X_VERSION_MIN_REQUIRED < 101500
0076 #define CLI11_HAS_FILESYSTEM 0
0077 #elif defined(__wasi__)
0078 // As of wasi-sdk-14, filesystem is not implemented
0079 #define CLI11_HAS_FILESYSTEM 0
0080 #else
0081 #include <filesystem>
0082 #if defined __cpp_lib_filesystem && __cpp_lib_filesystem >= 201703
0083 #if defined _GLIBCXX_RELEASE && _GLIBCXX_RELEASE >= 9
0084 #define CLI11_HAS_FILESYSTEM 1
0085 #elif defined(__GLIBCXX__)
0086 // if we are using gcc and Version <9 default to no filesystem
0087 #define CLI11_HAS_FILESYSTEM 0
0088 #else
0089 #define CLI11_HAS_FILESYSTEM 1
0090 #endif
0091 #else
0092 #define CLI11_HAS_FILESYSTEM 0
0093 #endif
0094 #endif
0095 #endif
0096 #endif
0097 
0098 /** <codecvt> availability */
0099 #if defined(__GNUC__) && !defined(__llvm__) && !defined(__INTEL_COMPILER) && __GNUC__ < 5
0100 #define CLI11_HAS_CODECVT 0
0101 #else
0102 #define CLI11_HAS_CODECVT 1
0103 #include <codecvt>
0104 #endif
0105 
0106 /** disable deprecations */
0107 #if defined(__GNUC__)  // GCC or clang
0108 #define CLI11_DIAGNOSTIC_PUSH _Pragma("GCC diagnostic push")
0109 #define CLI11_DIAGNOSTIC_POP _Pragma("GCC diagnostic pop")
0110 
0111 #define CLI11_DIAGNOSTIC_IGNORE_DEPRECATED _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
0112 
0113 #elif defined(_MSC_VER)
0114 #define CLI11_DIAGNOSTIC_PUSH __pragma(warning(push))
0115 #define CLI11_DIAGNOSTIC_POP __pragma(warning(pop))
0116 
0117 #define CLI11_DIAGNOSTIC_IGNORE_DEPRECATED __pragma(warning(disable : 4996))
0118 
0119 #else
0120 #define CLI11_DIAGNOSTIC_PUSH
0121 #define CLI11_DIAGNOSTIC_POP
0122 
0123 #define CLI11_DIAGNOSTIC_IGNORE_DEPRECATED
0124 
0125 #endif
0126 
0127 /** Inline macro **/
0128 #ifdef CLI11_COMPILE
0129 #define CLI11_INLINE
0130 #else
0131 #define CLI11_INLINE inline
0132 #endif
0133 // [CLI11:macros_hpp:end]