Itasca C++ Interface
export.h
Go to the documentation of this file.
1 #pragma once
2 
3 //#ifdef _DEBUG
4 //# define _CTRDBG_MAP_ALLOC
5 //# include <stdlib.h>
6 //# include <crtdbg.h>
7 //#endif
13 #ifdef _WIN32 // Identify compilers on Win32
14 # define EXPORT_TAG __declspec(dllexport)
15 # define IMPORT_TAG __declspec(dllimport)
16 # if _MSC_VER >= 1910
17 # define VS2017
18 # endif
19 # if _MSC_VER >= 1920
20 # define VS2019
21 # endif
22 #if defined(_MSC_VER) && !defined(__clang__) && !defined(__INTEL_COMPILER) && !defined(__INTEL_LLVM_COMPILER)
23 # define VSCOMP
24 # endif
25 # if defined(__clang__) && !defined(__INTEL_LLVM_COMPILER)
26 # define CLANGCOMP
27 # endif
28 # ifdef __INTEL_LLVM_COMPILER
29 # define INTELLLVMCOMP // Intel identifies itself as clang
30 # endif
31 # ifdef __INTEL_COMPILER
32 # define INTELCOMP
33 # endif
34 #endif
35 #ifdef __LINUX // Identify compilers on Linux
36 # define EXPORT_TAG
37 # define IMPORT_TAG
38 # if defined(__clang__) && !defined(__INTEL_LLVM_COMPILER)
39 # define CLANGCOMP
40 # endif
41 # if defined(__GNUC__) && !defined(__clang__) && !defined(__INTEL_COMPILER)
42 # define GNUCOMP
43 # endif
44 # if defined(__INTEL_COMPILER)
45 # define INTELCOMP
46 # endif
47 # ifdef __INTEL_LLVM_COMPILER
48 # define INTELLLVMCOMP
49 # endif
50 #endif
51 
52 // NOTE: Conventions on which compiler
53 // INTELCOMP means Intel C++ classic (icl)
54 // INTELLLVMCOMP means oneAPI Intel C++ (icx)
55 // VSCOMP means Visual Studio (MSVC)
56 // CLANGCOMP means Clang
57 // GNUCOMP means GCC
58 
59 #define DOPRAGMA(x) _Pragma(#x)
60 
61 #define INTELWARNING(x)
62 #define INTELLLVMWARNING(x)
63 #define GNUWARNING(x)
64 #define CLANGWARNING(x)
65 #define VSWARNING(x)
66 
67 #ifdef INTELCOMP
68 # define PUSHWARNING DOPRAGMA(warning(push))
69 # define POPWARNING DOPRAGMA(warning(pop))
70 # undef INTELWARNING
71 # define INTELWARNING(x) DOPRAGMA(warning(disable:x))
72 # include <iso646.h> // and not or macros
73 #endif
74 
75 #ifdef VSCOMP
76 # define PUSHWARNING DOPRAGMA(warning(push))
77 # define POPWARNING DOPRAGMA(warning(pop))
78 # undef VSWARNING
79 # define VSWARNING(x) DOPRAGMA(warning(disable:x))
80 #endif
81 
82 #ifdef CLANGCOMP
83 # define PUSHWARNING DOPRAGMA(clang diagnostic push)
84 # define POPWARNING DOPRAGMA(clang diagnostic pop)
85 # undef CLANGWARNING
86 # define CLANGWARNING(x) DOPRAGMA(clang diagnostic ignored x)
87 #endif
88 
89 #ifdef INTELLLVMCOMP
90 #define PUSHWARNING DOPRAGMA(clang diagnostic push)
91 #define POPWARNING DOPRAGMA(clang diagnostic pop)
92 #undef INTELLLVMWARNING
93 #define INTELLLVMWARNING(x) DOPRAGMA(clang diagnostic ignored x)
94 #endif
95 
96 #ifdef GNUCOMP
97 # define PUSHWARNING DOPRAGMA(GCC diagnostic push)
98 # define POPWARNING DOPRAGMA(GCC diagnostic pop)
99 # undef GNUWARNING
100 # define GNUWARNING(x) DOPRAGMA(GCC diagnostic ignored x)
101 #endif
102 
103 #ifndef GNUCOMP
104 # define TEMPLATE template
105 #else
106 # define TEMPLATE
107 #endif
108 
110 // EoF