ufe  2.0
Universal Front End is a DCC-agnostic component that will allow a DCC to browse and edit data in multiple data models
CfgCompilerMacros.h
Go to the documentation of this file.
1 #line 1 "S:/jenkins/workspace/ufe-full-windows/ufe/gitmodules/peptide/src/config/CfgCompilerMacros.h"
2 //-
3 // =============================================================================
4 // Copyright 2020 Autodesk, Inc. All rights reserved.
5 //
6 // Use of this software is subject to the terms of the Autodesk license
7 // agreement provided at the time of installation or download, or which
8 // otherwise accompanies this software in either electronic or hard copy form.
9 // =============================================================================
10 //+
11 
14 
15 
16 #ifndef PEPTIDE_CFG_COMPILER_MACROS_H
17 #define PEPTIDE_CFG_COMPILER_MACROS_H
18 
19 
20 //==============================================================================
21 // PLATFORM DETECTION
22 //==============================================================================
23 
24 #if defined(_WIN32)
25 #define PEPTIDE_WINDOWS
26 #elif defined(__linux__)
27 #define PEPTIDE_LINUX
28 #elif defined(__APPLE__)
29 #define PEPTIDE_OSX
30 #else
31 #error "Unsupported platform..."
32 #endif
33 
34 
35 //==============================================================================
36 // COMPILER DETECTION
37 //==============================================================================
38 
39 #if defined(__clang__)
40 // Clang C++ emulates GCC and MSC, so it has to appear early.
41 #define PEPTIDE_IS_CLANG 1
42 #elif defined(__INTEL_COMPILER) || defined(__ICL) || defined(__ICC) || defined(__ECC)
43 // Intel emulates MSC, so it has to appear early.
44 #define PEPTIDE_IS_INTEL 1
45 #elif defined(__GNUC__)
46 // GNU C++.
47 #define PEPTIDE_IS_GCC 1
48 #elif defined(_MSC_VER)
49 // Microsoft visual studio
50 #define PEPTIDE_IS_MSC 1
51 #else
52 #error "Unknown compiler configuration..."
53 #endif
54 
55 
56 // MSC Compiler versions
57 #ifdef PEPTIDE_IS_MSC
58 
59 #if _MSC_VER <= 1900
60 #define PEPTIDE_AT_MOST_MSVC2015 1
61 #endif
62 
63 #endif
64 
65 
66 // Default values...
67 #ifndef PEPTIDE_IS_CLANG
68 #define PEPTIDE_IS_CLANG 0
69 #endif
70 
71 #ifndef PEPTIDE_IS_GCC
72 #define PEPTIDE_IS_GCC 0
73 #endif
74 
75 #ifndef PEPTIDE_IS_INTEL
76 #define PEPTIDE_IS_INTEL 0
77 #endif
78 
79 #ifndef PEPTIDE_IS_MSC
80 #define PEPTIDE_IS_MSC 0
81 #endif
82 
83 #ifndef PEPTIDE_AT_MOST_MSVC2015
84 #define PEPTIDE_AT_MOST_MSVC2015 0
85 #endif
86 
87 
88 //==============================================================================
89 // FEATURE DETECTION
90 //==============================================================================
91 
92 // Stub out __has_feature when not supported by a given compiler
93 #ifndef __has_feature
94 #define __has_feature(x) 0
95 #endif
96 
97 //==============================================================================
98 // COMPILER CAPABILITIES
99 //==============================================================================
100 
105 #if __has_feature(cxx_rtti) || defined(__GXX_RTTI) || defined(_CPPRTTI)
106 #define PEPTIDE_HAS_CXX_RTTI 1
107 #else
108 #define PEPTIDE_HAS_CXX_RTTI 0
109 #endif
110 
116 #if PEPTIDE_IS_MSC || PEPTIDE_IS_INTEL
117 
118 #define PEPTIDE_FORCEINLINE __forceinline
119 
120 #elif PEPTIDE_IS_GCC || PEPTIDE_IS_CLANG
121 
122 #define PEPTIDE_FORCEINLINE inline __attribute__((always_inline))
123 
124 #endif
125 
140 #if PEPTIDE_IS_MSC
141 
142 #define PEPTIDE_NOINLINE __declspec(noinline)
143 
144 #elif PEPTIDE_IS_GCC || PEPTIDE_IS_CLANG || PEPTIDE_IS_INTEL
145 
146 #define PEPTIDE_NOINLINE __attribute__((noinline))
147 
148 #endif
149 
164 #if PEPTIDE_IS_MSC
165 #define PEPTIDE_ENABLE_ECBO __declspec(empty_bases)
166 #else
167 #define PEPTIDE_ENABLE_ECBO
168 #endif
169 
170 //==============================================================================
171 // EXPORT DIRECTIVES
172 //==============================================================================
173 
179 #if PEPTIDE_IS_GCC || PEPTIDE_IS_CLANG
180 #define PEPTIDE_EXPORT_UNIX __attribute__((visibility("default")))
181 #else
182 #define PEPTIDE_EXPORT_UNIX
183 #endif
184 
185 #endif