Go to the documentation of this file.
24 #ifndef PXR_BASE_ARCH_PRAGMAS_H
25 #define PXR_BASE_ARCH_PRAGMAS_H
36 #if defined(ARCH_COMPILER_GCC)
38 #define ARCH_PRAGMA_PUSH \
39 _Pragma("GCC diagnostic push")
41 #define ARCH_PRAGMA_POP \
42 _Pragma("GCC diagnostic pop")
44 #define ARCH_PRAGMA(x) _Pragma(#x)
46 #define ARCH_PRAGMA_PUSH_MACRO(macro_name) \
47 ARCH_PRAGMA(push_macro(#macro_name))
49 #define ARCH_PRAGMA_POP_MACRO(macro_name) \
50 ARCH_PRAGMA(pop_macro(#macro_name))
56 #define ARCH_PRAGMA_MAYBE_UNINITIALIZED \
57 _Pragma("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
59 #define ARCH_PRAGMA_MACRO_REDEFINITION \
60 _Pragma("GCC diagnostic ignored \"-Wbuiltin-macro-redefined\"")
62 #define ARCH_PRAGMA_WRITE_STRINGS \
63 _Pragma("GCC diagnostic ignored \"-Wwrite-strings\"")
65 #define ARCH_PRAGMA_UNUSED_FUNCTION \
66 _Pragma("GCC diagnostic ignored \"-Wunused-function\"")
68 #elif defined(ARCH_COMPILER_CLANG)
70 #define ARCH_PRAGMA_PUSH \
71 _Pragma("clang diagnostic push")
73 #define ARCH_PRAGMA_POP \
74 _Pragma("clang diagnostic pop")
76 #define ARCH_PRAGMA(x) _Pragma(#x)
78 #define ARCH_PRAGMA_PUSH_MACRO(macro_name) \
79 ARCH_PRAGMA(push_macro(#macro_name))
81 #define ARCH_PRAGMA_POP_MACRO(macro_name) \
82 ARCH_PRAGMA(pop_macro(#macro_name))
84 #define ARCH_PRAGMA_MACRO_REDEFINITION \
85 _Pragma("clang diagnostic ignored \"-Wbuiltin-macro-redefined\"")
87 #define ARCH_PRAGMA_UNDEFINED_VAR_TEMPLATE \
88 _Pragma("clang diagnostic ignored \"-Wundefined-var-template\"")
90 #define ARCH_PRAGMA_WRITE_STRINGS \
91 _Pragma("clang diagnostic ignored \"-Wwrite-strings\"")
93 #define ARCH_PRAGMA_UNUSED_FUNCTION \
94 _Pragma("clang diagnostic ignored \"-Wunused-function\"")
96 #define ARCH_PRAGMA_UNUSED_PRIVATE_FIELD \
97 _Pragma("clang diagnostic ignored \"-Wunused-private-field\"")
99 #define ARCH_PRAGMA_INSTANTIATION_AFTER_SPECIALIZATION \
100 _Pragma("clang diagnostic ignored \"-Winstantiation-after-specialization\"")
102 #define ARCH_PRAGMA_INSTANCE_METHOD_NOT_FOUND \
103 _Pragma("clang diagnostic ignored \"-Wobjc-method-access\"")
105 #elif defined(ARCH_COMPILER_MSVC)
107 #define ARCH_PRAGMA_PUSH \
108 __pragma(warning(push))
110 #define ARCH_PRAGMA_POP \
111 __pragma(warning(pop))
113 #define ARCH_PRAGMA(x) __pragma(x)
115 #define ARCH_PRAGMA_PUSH_MACRO(macro_name) \
116 __pragma(push_macro(#macro_name))
118 #define ARCH_PRAGMA_POP_MACRO(macro_name) \
119 __pragma(pop_macro(#macro_name))
121 #define ARCH_PRAGMA_MACRO_TOO_FEW_ARGUMENTS \
122 __pragma(warning(disable:4003))
124 #define ARCH_PRAGMA_MACRO_REDEFINITION \
125 __pragma(warning(disable:4005))
127 #define ARCH_PRAGMA_UNUSED_FUNCTION \
128 __pragma(warning(disable:4505))
130 #define ARCH_PRAGMA_QUALIFIER_HAS_NO_MEANING \
131 __pragma(warning(disable:4180))
133 #define ARCH_PRAGMA_ZERO_SIZED_STRUCT \
134 __pragma(warning(disable:4200))
136 #define ARCH_PRAGMA_NEEDS_EXPORT_INTERFACE \
137 __pragma(warning(disable:4251))
139 #define ARCH_PRAGMA_CONVERSION_FROM_SIZET \
140 __pragma(warning(disable:4267))
142 #define ARCH_PRAGMA_MAY_NOT_BE_ALIGNED \
143 __pragma(warning(disable:4316))
145 #define ARCH_PRAGMA_SHIFT_TO_64_BITS \
146 __pragma(warning(disable:4334))
148 #define ARCH_PRAGMA_DESTRUCTOR_IMPLICIT_DEFINE \
149 __pragma(warning(disable:4624))
151 #define ARCH_PRAGMA_DEPRECATED_POSIX_NAME \
152 __pragma(warning(disable:4996))
154 #define ARCH_PRAGMA_FORCING_TO_BOOL \
155 __pragma(warning(disable:4800))
157 #define ARCH_PRAGMA_UNSAFE_USE_OF_BOOL \
158 __pragma(warning(disable:4804))
160 #define ARCH_PRAGMA_UNARY_MINUS_ON_UNSIGNED \
161 __pragma(warning(disable:4146))
165 #if !defined ARCH_PRAGMA_PUSH
166 #define ARCH_PRAGMA_PUSH
169 #if !defined ARCH_PRAGMA_POP
170 #define ARCH_PRAGMA_POP
173 #if !defined ARCH_PRAGMA
177 #if !defined ARCH_PRAGMA_PUSH_MACRO
178 #define ARCH_PRAGMA_PUSH_MACRO
181 #if !defined ARCH_PRAGMA_POP_MACRO
182 #define ARCH_PRAGMA_POP_MACRO
185 #if !defined ARCH_PRAGMA_MAYBE_UNINITIALIZED
186 #define ARCH_PRAGMA_MAYBE_UNINITIALIZED
189 #if !defined ARCH_PRAGMA_MACRO_REDEFINITION
190 #define ARCH_PRAGMA_MACRO_REDEFINITION
193 #if !defined ARCH_PRAGMA_WRITE_STRINGS
194 #define ARCH_PRAGMA_WRITE_STRINGS
197 #if !defined ARCH_PRAGMA_UNUSED_FUNCTION
198 #define ARCH_PRAGMA_UNUSED_FUNCTION
201 #if !defined ARCH_PRAGMA_UNUSED_PRIVATE_FIELD
202 #define ARCH_PRAGMA_UNUSED_PRIVATE_FIELD
205 #if !defined ARCH_PRAGMA_MACRO_TOO_FEW_ARGUMENTS
206 #define ARCH_PRAGMA_MACRO_TOO_FEW_ARGUMENTS
209 #if !defined ARCH_PRAGMA_QUALIFIER_HAS_NO_MEANING
210 #define ARCH_PRAGMA_QUALIFIER_HAS_NO_MEANING
213 #if !defined ARCH_PRAGMA_ZERO_SIZED_STRUCT
214 #define ARCH_PRAGMA_ZERO_SIZED_STRUCT
217 #if !defined ARCH_PRAGMA_NEEDS_EXPORT_INTERFACE
218 #define ARCH_PRAGMA_NEEDS_EXPORT_INTERFACE
221 #if !defined ARCH_PRAGMA_CONVERSION_FROM_SIZET
222 #define ARCH_PRAGMA_CONVERSION_FROM_SIZET
225 #if !defined ARCH_PRAGMA_MAY_NOT_BE_ALIGNED
226 #define ARCH_PRAGMA_MAY_NOT_BE_ALIGNED
229 #if !defined ARCH_PRAGMA_SHIFT_TO_64_BITS
230 #define ARCH_PRAGMA_SHIFT_TO_64_BITS
233 #if !defined ARCH_PRAGMA_DESTRUCTOR_IMPLICIT_DEFINE
234 #define ARCH_PRAGMA_DESTRUCTOR_IMPLICIT_DEFINE
237 #if !defined ARCH_PRAGMA_DEPRECATED_POSIX_NAME
238 #define ARCH_PRAGMA_DEPRECATED_POSIX_NAME
241 #if !defined ARCH_PRAGMA_FORCING_TO_BOOL
242 #define ARCH_PRAGMA_FORCING_TO_BOOL
245 #if !defined ARCH_PRAGMA_UNSAFE_USE_OF_BOOL
246 #define ARCH_PRAGMA_UNSAFE_USE_OF_BOOL
249 #if !defined ARCH_PRAGMA_UNARY_MINUS_ON_UNSIGNED
250 #define ARCH_PRAGMA_UNARY_MINUS_ON_UNSIGNED
253 #if !defined ARCH_PRAGMA_INSTANTIATION_AFTER_SPECIALIZATION
254 #define ARCH_PRAGMA_INSTANTIATION_AFTER_SPECIALIZATION
257 #if !defined ARCH_PRAGMA_UNDEFINED_VAR_TEMPLATE
258 #define ARCH_PRAGMA_UNDEFINED_VAR_TEMPLATE
261 #if !defined ARCH_PRAGMA_INSTANCE_METHOD_NOT_FOUND
262 #define ARCH_PRAGMA_INSTANCE_METHOD_NOT_FOUND
265 #endif // PXR_BASE_ARCH_PRAGMAS_H