File indexing completed on 2026-01-09 10:20:47
0001
0002
0003
0004
0005 #pragma once
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019 #if defined(_MSC_VER)
0020 # define PYBIND11_COMPILER_MSVC
0021 # define PYBIND11_PRAGMA(...) __pragma(__VA_ARGS__)
0022 # define PYBIND11_WARNING_PUSH PYBIND11_PRAGMA(warning(push))
0023 # define PYBIND11_WARNING_POP PYBIND11_PRAGMA(warning(pop))
0024 #elif defined(__INTEL_COMPILER)
0025 # define PYBIND11_COMPILER_INTEL
0026 # define PYBIND11_PRAGMA(...) _Pragma(#__VA_ARGS__)
0027 # define PYBIND11_WARNING_PUSH PYBIND11_PRAGMA(warning push)
0028 # define PYBIND11_WARNING_POP PYBIND11_PRAGMA(warning pop)
0029 #elif defined(__clang__)
0030 # define PYBIND11_COMPILER_CLANG
0031 # define PYBIND11_PRAGMA(...) _Pragma(#__VA_ARGS__)
0032 # define PYBIND11_WARNING_PUSH PYBIND11_PRAGMA(clang diagnostic push)
0033 # define PYBIND11_WARNING_POP PYBIND11_PRAGMA(clang diagnostic pop)
0034 #elif defined(__GNUC__)
0035 # define PYBIND11_COMPILER_GCC
0036 # define PYBIND11_PRAGMA(...) _Pragma(#__VA_ARGS__)
0037 # define PYBIND11_WARNING_PUSH PYBIND11_PRAGMA(GCC diagnostic push)
0038 # define PYBIND11_WARNING_POP PYBIND11_PRAGMA(GCC diagnostic pop)
0039 #endif
0040
0041 #ifdef PYBIND11_COMPILER_MSVC
0042 # define PYBIND11_WARNING_DISABLE_MSVC(name) PYBIND11_PRAGMA(warning(disable : name))
0043 #else
0044 # define PYBIND11_WARNING_DISABLE_MSVC(name)
0045 #endif
0046
0047 #ifdef PYBIND11_COMPILER_CLANG
0048 # define PYBIND11_WARNING_DISABLE_CLANG(name) PYBIND11_PRAGMA(clang diagnostic ignored name)
0049 #else
0050 # define PYBIND11_WARNING_DISABLE_CLANG(name)
0051 #endif
0052
0053 #ifdef PYBIND11_COMPILER_GCC
0054 # define PYBIND11_WARNING_DISABLE_GCC(name) PYBIND11_PRAGMA(GCC diagnostic ignored name)
0055 #else
0056 # define PYBIND11_WARNING_DISABLE_GCC(name)
0057 #endif
0058
0059 #ifdef PYBIND11_COMPILER_INTEL
0060 # define PYBIND11_WARNING_DISABLE_INTEL(name) PYBIND11_PRAGMA(warning disable name)
0061 #else
0062 # define PYBIND11_WARNING_DISABLE_INTEL(name)
0063 #endif
0064
0065 #define PYBIND11_NAMESPACE_BEGIN(name) \
0066 namespace name { \
0067 PYBIND11_WARNING_PUSH
0068
0069 #define PYBIND11_NAMESPACE_END(name) \
0070 PYBIND11_WARNING_POP \
0071 }
0072
0073
0074
0075
0076 #if !defined(PYBIND11_NAMESPACE)
0077 # if defined(__GNUG__) && !defined(_WIN32)
0078 # define PYBIND11_NAMESPACE pybind11 __attribute__((visibility("hidden")))
0079 # else
0080 # define PYBIND11_NAMESPACE pybind11
0081 # endif
0082 #endif