Loading...
Searching...
No Matches
Go to the documentation of this file.
7#ifndef PXR_BASE_ARCH_PRAGMAS_H
8#define PXR_BASE_ARCH_PRAGMAS_H
17#include "pxr/base/arch/defines.h"
19#if defined(ARCH_COMPILER_GCC)
21 #define ARCH_PRAGMA_PUSH \
22 _Pragma("GCC diagnostic push")
24 #define ARCH_PRAGMA_POP \
25 _Pragma("GCC diagnostic pop")
27 #define ARCH_PRAGMA(x) _Pragma(#x)
29 #define ARCH_PRAGMA_PUSH_MACRO(macro_name) \
30 ARCH_PRAGMA(push_macro(#macro_name))
32 #define ARCH_PRAGMA_POP_MACRO(macro_name) \
33 ARCH_PRAGMA(pop_macro(#macro_name))
39 #define ARCH_PRAGMA_MAYBE_UNINITIALIZED \
40 _Pragma("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
42 #define ARCH_PRAGMA_MACRO_REDEFINITION \
43 _Pragma("GCC diagnostic ignored \"-Wbuiltin-macro-redefined\"")
45 #define ARCH_PRAGMA_WRITE_STRINGS \
46 _Pragma("GCC diagnostic ignored \"-Wwrite-strings\"")
48 #define ARCH_PRAGMA_UNUSED_FUNCTION \
49 _Pragma("GCC diagnostic ignored \"-Wunused-function\"")
51#elif defined(ARCH_COMPILER_CLANG)
53 #define ARCH_PRAGMA_PUSH \
54 _Pragma("clang diagnostic push")
56 #define ARCH_PRAGMA_POP \
57 _Pragma("clang diagnostic pop")
59 #define ARCH_PRAGMA(x) _Pragma(#x)
61 #define ARCH_PRAGMA_PUSH_MACRO(macro_name) \
62 ARCH_PRAGMA(push_macro(#macro_name))
64 #define ARCH_PRAGMA_POP_MACRO(macro_name) \
65 ARCH_PRAGMA(pop_macro(#macro_name))
67 #define ARCH_PRAGMA_MACRO_REDEFINITION \
68 _Pragma("clang diagnostic ignored \"-Wbuiltin-macro-redefined\"")
70 #define ARCH_PRAGMA_UNDEFINED_VAR_TEMPLATE \
71 _Pragma("clang diagnostic ignored \"-Wundefined-var-template\"")
73 #define ARCH_PRAGMA_WRITE_STRINGS \
74 _Pragma("clang diagnostic ignored \"-Wwrite-strings\"")
76 #define ARCH_PRAGMA_UNUSED_FUNCTION \
77 _Pragma("clang diagnostic ignored \"-Wunused-function\"")
79 #define ARCH_PRAGMA_UNUSED_PRIVATE_FIELD \
80 _Pragma("clang diagnostic ignored \"-Wunused-private-field\"")
82 #define ARCH_PRAGMA_INSTANTIATION_AFTER_SPECIALIZATION \
83 _Pragma("clang diagnostic ignored \"-Winstantiation-after-specialization\"")
85 #define ARCH_PRAGMA_INSTANCE_METHOD_NOT_FOUND \
86 _Pragma("clang diagnostic ignored \"-Wobjc-method-access\"")
88#elif defined(ARCH_COMPILER_MSVC)
90 #define ARCH_PRAGMA_PUSH \
91 __pragma(warning(push))
93 #define ARCH_PRAGMA_POP \
94 __pragma(warning(pop))
96 #define ARCH_PRAGMA(x) __pragma(x)
98 #define ARCH_PRAGMA_PUSH_MACRO(macro_name) \
99 __pragma(push_macro(#macro_name))
101 #define ARCH_PRAGMA_POP_MACRO(macro_name) \
102 __pragma(pop_macro(#macro_name))
104 #define ARCH_PRAGMA_MACRO_TOO_FEW_ARGUMENTS \
105 __pragma(warning(disable:4003))
107 #define ARCH_PRAGMA_MACRO_REDEFINITION \
108 __pragma(warning(disable:4005))
110 #define ARCH_PRAGMA_UNUSED_FUNCTION \
111 __pragma(warning(disable:4505))
113 #define ARCH_PRAGMA_QUALIFIER_HAS_NO_MEANING \
114 __pragma(warning(disable:4180))
116 #define ARCH_PRAGMA_ZERO_SIZED_STRUCT \
117 __pragma(warning(disable:4200))
119 #define ARCH_PRAGMA_NEEDS_EXPORT_INTERFACE \
120 __pragma(warning(disable:4251))
122 #define ARCH_PRAGMA_CONVERSION_FROM_SIZET \
123 __pragma(warning(disable:4267))
125 #define ARCH_PRAGMA_MAY_NOT_BE_ALIGNED \
126 __pragma(warning(disable:4316))
128 #define ARCH_PRAGMA_SHIFT_TO_64_BITS \
129 __pragma(warning(disable:4334))
131 #define ARCH_PRAGMA_DESTRUCTOR_IMPLICIT_DEFINE \
132 __pragma(warning(disable:4624))
134 #define ARCH_PRAGMA_DEPRECATED_POSIX_NAME \
135 __pragma(warning(disable:4996))
137 #define ARCH_PRAGMA_FORCING_TO_BOOL \
138 __pragma(warning(disable:4800))
140 #define ARCH_PRAGMA_UNSAFE_USE_OF_BOOL \
141 __pragma(warning(disable:4804))
143 #define ARCH_PRAGMA_UNARY_MINUS_ON_UNSIGNED \
144 __pragma(warning(disable:4146))
148#if !defined ARCH_PRAGMA_PUSH
149 #define ARCH_PRAGMA_PUSH
152#if !defined ARCH_PRAGMA_POP
153 #define ARCH_PRAGMA_POP
156#if !defined ARCH_PRAGMA
160#if !defined ARCH_PRAGMA_PUSH_MACRO
161 #define ARCH_PRAGMA_PUSH_MACRO
164#if !defined ARCH_PRAGMA_POP_MACRO
165 #define ARCH_PRAGMA_POP_MACRO
168#if !defined ARCH_PRAGMA_MAYBE_UNINITIALIZED
169 #define ARCH_PRAGMA_MAYBE_UNINITIALIZED
172#if !defined ARCH_PRAGMA_MACRO_REDEFINITION
173 #define ARCH_PRAGMA_MACRO_REDEFINITION
176#if !defined ARCH_PRAGMA_WRITE_STRINGS
177 #define ARCH_PRAGMA_WRITE_STRINGS
180#if !defined ARCH_PRAGMA_UNUSED_FUNCTION
181 #define ARCH_PRAGMA_UNUSED_FUNCTION
184#if !defined ARCH_PRAGMA_UNUSED_PRIVATE_FIELD
185 #define ARCH_PRAGMA_UNUSED_PRIVATE_FIELD
188#if !defined ARCH_PRAGMA_MACRO_TOO_FEW_ARGUMENTS
189 #define ARCH_PRAGMA_MACRO_TOO_FEW_ARGUMENTS
192#if !defined ARCH_PRAGMA_QUALIFIER_HAS_NO_MEANING
193 #define ARCH_PRAGMA_QUALIFIER_HAS_NO_MEANING
196#if !defined ARCH_PRAGMA_ZERO_SIZED_STRUCT
197 #define ARCH_PRAGMA_ZERO_SIZED_STRUCT
200#if !defined ARCH_PRAGMA_NEEDS_EXPORT_INTERFACE
201 #define ARCH_PRAGMA_NEEDS_EXPORT_INTERFACE
204#if !defined ARCH_PRAGMA_CONVERSION_FROM_SIZET
205 #define ARCH_PRAGMA_CONVERSION_FROM_SIZET
208#if !defined ARCH_PRAGMA_MAY_NOT_BE_ALIGNED
209 #define ARCH_PRAGMA_MAY_NOT_BE_ALIGNED
212#if !defined ARCH_PRAGMA_SHIFT_TO_64_BITS
213 #define ARCH_PRAGMA_SHIFT_TO_64_BITS
216#if !defined ARCH_PRAGMA_DESTRUCTOR_IMPLICIT_DEFINE
217 #define ARCH_PRAGMA_DESTRUCTOR_IMPLICIT_DEFINE
220#if !defined ARCH_PRAGMA_DEPRECATED_POSIX_NAME
221 #define ARCH_PRAGMA_DEPRECATED_POSIX_NAME
224#if !defined ARCH_PRAGMA_FORCING_TO_BOOL
225 #define ARCH_PRAGMA_FORCING_TO_BOOL
228#if !defined ARCH_PRAGMA_UNSAFE_USE_OF_BOOL
229 #define ARCH_PRAGMA_UNSAFE_USE_OF_BOOL
232#if !defined ARCH_PRAGMA_UNARY_MINUS_ON_UNSIGNED
233 #define ARCH_PRAGMA_UNARY_MINUS_ON_UNSIGNED
236#if !defined ARCH_PRAGMA_INSTANTIATION_AFTER_SPECIALIZATION
237 #define ARCH_PRAGMA_INSTANTIATION_AFTER_SPECIALIZATION
240#if !defined ARCH_PRAGMA_UNDEFINED_VAR_TEMPLATE
241 #define ARCH_PRAGMA_UNDEFINED_VAR_TEMPLATE
244#if !defined ARCH_PRAGMA_INSTANCE_METHOD_NOT_FOUND
245 #define ARCH_PRAGMA_INSTANCE_METHOD_NOT_FOUND