ufe 6.2
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 "D:/Jenkins/workspace/EMS/ECG/ufe/full/ufe-full-python3.11-windows/ufe/gitmodules/peptide/src/config/CfgCompilerMacros.h"
2//-
3// =============================================================================
4// Copyright 2021 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#ifndef PEPTIDE_CFG_COMPILER_MACROS_H
16#define PEPTIDE_CFG_COMPILER_MACROS_H
17
18//==============================================================================
19// PLATFORM DETECTION
20//==============================================================================
21
22#if defined(_WIN32)
23#define PEPTIDE_WINDOWS
24#elif defined(__linux__)
25#define PEPTIDE_LINUX
26#elif defined(__APPLE__)
27#define PEPTIDE_OSX
28#elif defined(__EMSCRIPTEN__)
29#define PEPTIDE_EMSCRIPTEN
30#else
31#error "Unsupported platform..."
32#endif
33
34//==============================================================================
35// COMPILER TARGET DETECTION - the arch compiler is compiling for.
36//==============================================================================
37// GCC and clang defines __aarch64__
38// MSVC defines _M_ARM64
39#if (defined(__aarch64__) || defined(_M_ARM64))
40#define PEPTIDE_ARCH_IS_ARM64 1
41#define PEPTIDE_ARCH_IS_X86_64 0
42#elif (defined(__x86_64__) || defined(_M_AMD64))
43#define PEPTIDE_ARCH_IS_X86_64 1
44#define PEPTIDE_ARCH_IS_ARM64 0
45#else
46#define PEPTIDE_ARCH_IS_X86_64 0
47#define PEPTIDE_ARCH_IS_ARM64 0
48#endif
49
50//==============================================================================
51// COMPILER DETECTION
52//==============================================================================
53
54#if defined(__clang__)
55// Clang C++ emulates GCC and MSC, so it has to appear early.
56#define PEPTIDE_IS_CLANG 1
57#elif defined(__INTEL_COMPILER) || defined(__ICL) || defined(__ICC) || defined(__ECC)
58// Intel emulates MSC, so it has to appear early.
59#define PEPTIDE_IS_INTEL 1
60#elif defined(__GNUC__)
61// GNU C++.
62#define PEPTIDE_IS_GCC 1
63#elif defined(_MSC_VER)
64// Microsoft visual studio
65#define PEPTIDE_IS_MSC 1
66#else
67#error "Unknown compiler configuration..."
68#endif
69
70// MSC Compiler versions
71#ifdef PEPTIDE_IS_MSC
72
73#if _MSC_VER <= 1900
74#define PEPTIDE_AT_MOST_MSVC2015 1
75#endif
76
77#endif
78
79// Default values...
80#ifndef PEPTIDE_IS_CLANG
81#define PEPTIDE_IS_CLANG 0
82#endif
83
84#ifndef PEPTIDE_IS_GCC
85#define PEPTIDE_IS_GCC 0
86#endif
87
88#ifndef PEPTIDE_IS_INTEL
89#define PEPTIDE_IS_INTEL 0
90#endif
91
92#ifndef PEPTIDE_IS_MSC
93#define PEPTIDE_IS_MSC 0
94#endif
95
96#ifndef PEPTIDE_AT_MOST_MSVC2015
97#define PEPTIDE_AT_MOST_MSVC2015 0
98#endif
99
100//==============================================================================
101// FEATURE DETECTION
102//==============================================================================
103
104// Stub out __has_feature when not supported by a given compiler
105#ifndef __has_feature
106#define __has_feature(x) 0
107#endif
108
109//==============================================================================
110// COMPATIBILITY ACROSS C++ STANDARDS.
111//==============================================================================
112
140#if __cplusplus >= 202002L
141#define PEPTIDE_CXX20_CAPTURE_THIS , this
142#else
143#define PEPTIDE_CXX20_CAPTURE_THIS
144#endif
145
146//==============================================================================
147// COMPILER CAPABILITIES
148//==============================================================================
149
154#if __has_feature(cxx_rtti) || defined(__GXX_RTTI) || defined(_CPPRTTI)
155#define PEPTIDE_HAS_CXX_RTTI 1
156#else
157#define PEPTIDE_HAS_CXX_RTTI 0
158#endif
159
165#if PEPTIDE_IS_MSC || PEPTIDE_IS_INTEL
166
167#define PEPTIDE_FORCEINLINE __forceinline
168
169#elif PEPTIDE_IS_GCC || PEPTIDE_IS_CLANG
170
171#define PEPTIDE_FORCEINLINE inline __attribute__((always_inline))
172
173#endif
174
189#if PEPTIDE_IS_MSC
190
191#define PEPTIDE_NOINLINE __declspec(noinline)
192
193#elif PEPTIDE_IS_GCC || PEPTIDE_IS_CLANG || PEPTIDE_IS_INTEL
194
195#define PEPTIDE_NOINLINE __attribute__((noinline))
196
197#endif
198
213#if PEPTIDE_IS_MSC
214#define PEPTIDE_ENABLE_ECBO __declspec(empty_bases)
215#else
216#define PEPTIDE_ENABLE_ECBO
217#endif
218
219//==============================================================================
220// EXPORT DIRECTIVES
221//==============================================================================
222
228#if PEPTIDE_IS_GCC || PEPTIDE_IS_CLANG
229#define PEPTIDE_EXPORT_UNIX __attribute__((visibility("default")))
230#else
231#define PEPTIDE_EXPORT_UNIX
232#endif
233
234#endif