Loading...
Searching...
No Matches
Go to the documentation of this file.
8#ifndef PXR_ARCH_PRAGMAS_H
9#define PXR_ARCH_PRAGMAS_H
20#if defined(ARCH_COMPILER_GCC)
22 #define ARCH_PRAGMA_PUSH \
23 _Pragma("GCC diagnostic push")
25 #define ARCH_PRAGMA_POP \
26 _Pragma("GCC diagnostic pop")
28 #define ARCH_PRAGMA(x) _Pragma(#x)
30 #define ARCH_PRAGMA_PUSH_MACRO(macro_name) \
31 ARCH_PRAGMA(push_macro(#macro_name))
33 #define ARCH_PRAGMA_POP_MACRO(macro_name) \
34 ARCH_PRAGMA(pop_macro(#macro_name))
40 #define ARCH_PRAGMA_MAYBE_UNINITIALIZED \
41 _Pragma("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
43 #define ARCH_PRAGMA_MACRO_REDEFINITION \
44 _Pragma("GCC diagnostic ignored \"-Wbuiltin-macro-redefined\"")
46 #define ARCH_PRAGMA_WRITE_STRINGS \
47 _Pragma("GCC diagnostic ignored \"-Wwrite-strings\"")
49 #define ARCH_PRAGMA_UNUSED_FUNCTION \
50 _Pragma("GCC diagnostic ignored \"-Wunused-function\"")
52#elif defined(ARCH_COMPILER_CLANG)
54 #define ARCH_PRAGMA_PUSH \
55 _Pragma("clang diagnostic push")
57 #define ARCH_PRAGMA_POP \
58 _Pragma("clang diagnostic pop")
60 #define ARCH_PRAGMA(x) _Pragma(#x)
62 #define ARCH_PRAGMA_PUSH_MACRO(macro_name) \
63 ARCH_PRAGMA(push_macro(#macro_name))
65 #define ARCH_PRAGMA_POP_MACRO(macro_name) \
66 ARCH_PRAGMA(pop_macro(#macro_name))
68 #define ARCH_PRAGMA_MACRO_REDEFINITION \
69 _Pragma("clang diagnostic ignored \"-Wbuiltin-macro-redefined\"")
71 #define ARCH_PRAGMA_UNDEFINED_VAR_TEMPLATE \
72 _Pragma("clang diagnostic ignored \"-Wundefined-var-template\"")
74 #define ARCH_PRAGMA_WRITE_STRINGS \
75 _Pragma("clang diagnostic ignored \"-Wwrite-strings\"")
77 #define ARCH_PRAGMA_UNUSED_FUNCTION \
78 _Pragma("clang diagnostic ignored \"-Wunused-function\"")
80 #define ARCH_PRAGMA_UNUSED_PRIVATE_FIELD \
81 _Pragma("clang diagnostic ignored \"-Wunused-private-field\"")
83 #define ARCH_PRAGMA_INSTANTIATION_AFTER_SPECIALIZATION \
84 _Pragma("clang diagnostic ignored \"-Winstantiation-after-specialization\"")
86 #define ARCH_PRAGMA_INSTANCE_METHOD_NOT_FOUND \
87 _Pragma("clang diagnostic ignored \"-Wobjc-method-access\"")
89#elif defined(ARCH_COMPILER_MSVC)
91 #define ARCH_PRAGMA_PUSH \
92 __pragma(warning(push))
94 #define ARCH_PRAGMA_POP \
95 __pragma(warning(pop))
97 #define ARCH_PRAGMA(x) __pragma(x)
99 #define ARCH_PRAGMA_PUSH_MACRO(macro_name) \
100 __pragma(push_macro(#macro_name))
102 #define ARCH_PRAGMA_POP_MACRO(macro_name) \
103 __pragma(pop_macro(#macro_name))
105 #define ARCH_PRAGMA_MACRO_TOO_FEW_ARGUMENTS \
106 __pragma(warning(disable:4003))
108 #define ARCH_PRAGMA_MACRO_REDEFINITION \
109 __pragma(warning(disable:4005))
111 #define ARCH_PRAGMA_UNUSED_FUNCTION \
112 __pragma(warning(disable:4505))
114 #define PXR_ARCH_PRAGMA_QUALIFIER_HAS_NO_MEANING \
115 __pragma(warning(disable:4180))
117 #define ARCH_PRAGMA_ZERO_SIZED_STRUCT \
118 __pragma(warning(disable:4200))
120 #define ARCH_PRAGMA_NEEDS_EXPORT_INTERFACE \
121 __pragma(warning(disable:4251))
123 #define ARCH_PRAGMA_CONVERSION_FROM_SIZET \
124 __pragma(warning(disable:4267))
126 #define ARCH_PRAGMA_MAY_NOT_BE_ALIGNED \
127 __pragma(warning(disable:4316))
129 #define ARCH_PRAGMA_SHIFT_TO_64_BITS \
130 __pragma(warning(disable:4334))
132 #define ARCH_PRAGMA_DESTRUCTOR_IMPLICIT_DEFINE \
133 __pragma(warning(disable:4624))
135 #define ARCH_PRAGMA_DEPRECATED_POSIX_NAME \
136 __pragma(warning(disable:4996))
138 #define ARCH_PRAGMA_FORCING_TO_BOOL \
139 __pragma(warning(disable:4800))
141 #define ARCH_PRAGMA_UNSAFE_USE_OF_BOOL \
142 __pragma(warning(disable:4804))
144 #define ARCH_PRAGMA_UNARY_MINUS_ON_UNSIGNED \
145 __pragma(warning(disable:4146))
149#if !defined ARCH_PRAGMA_PUSH
150 #define ARCH_PRAGMA_PUSH
153#if !defined ARCH_PRAGMA_POP
154 #define ARCH_PRAGMA_POP
157#if !defined ARCH_PRAGMA
161#if !defined ARCH_PRAGMA_PUSH_MACRO
162 #define ARCH_PRAGMA_PUSH_MACRO
165#if !defined ARCH_PRAGMA_POP_MACRO
166 #define ARCH_PRAGMA_POP_MACRO
169#if !defined ARCH_PRAGMA_MAYBE_UNINITIALIZED
170 #define ARCH_PRAGMA_MAYBE_UNINITIALIZED
173#if !defined ARCH_PRAGMA_MACRO_REDEFINITION
174 #define ARCH_PRAGMA_MACRO_REDEFINITION
177#if !defined ARCH_PRAGMA_WRITE_STRINGS
178 #define ARCH_PRAGMA_WRITE_STRINGS
181#if !defined ARCH_PRAGMA_UNUSED_FUNCTION
182 #define ARCH_PRAGMA_UNUSED_FUNCTION
185#if !defined ARCH_PRAGMA_UNUSED_PRIVATE_FIELD
186 #define ARCH_PRAGMA_UNUSED_PRIVATE_FIELD
189#if !defined ARCH_PRAGMA_MACRO_TOO_FEW_ARGUMENTS
190 #define ARCH_PRAGMA_MACRO_TOO_FEW_ARGUMENTS
193#if !defined PXR_ARCH_PRAGMA_QUALIFIER_HAS_NO_MEANING
194 #define PXR_ARCH_PRAGMA_QUALIFIER_HAS_NO_MEANING
197#if !defined ARCH_PRAGMA_ZERO_SIZED_STRUCT
198 #define ARCH_PRAGMA_ZERO_SIZED_STRUCT
201#if !defined ARCH_PRAGMA_NEEDS_EXPORT_INTERFACE
202 #define ARCH_PRAGMA_NEEDS_EXPORT_INTERFACE
205#if !defined ARCH_PRAGMA_CONVERSION_FROM_SIZET
206 #define ARCH_PRAGMA_CONVERSION_FROM_SIZET
209#if !defined ARCH_PRAGMA_MAY_NOT_BE_ALIGNED
210 #define ARCH_PRAGMA_MAY_NOT_BE_ALIGNED
213#if !defined ARCH_PRAGMA_SHIFT_TO_64_BITS
214 #define ARCH_PRAGMA_SHIFT_TO_64_BITS
217#if !defined ARCH_PRAGMA_DESTRUCTOR_IMPLICIT_DEFINE
218 #define ARCH_PRAGMA_DESTRUCTOR_IMPLICIT_DEFINE
221#if !defined ARCH_PRAGMA_DEPRECATED_POSIX_NAME
222 #define ARCH_PRAGMA_DEPRECATED_POSIX_NAME
225#if !defined ARCH_PRAGMA_FORCING_TO_BOOL
226 #define ARCH_PRAGMA_FORCING_TO_BOOL
229#if !defined ARCH_PRAGMA_UNSAFE_USE_OF_BOOL
230 #define ARCH_PRAGMA_UNSAFE_USE_OF_BOOL
233#if !defined ARCH_PRAGMA_UNARY_MINUS_ON_UNSIGNED
234 #define ARCH_PRAGMA_UNARY_MINUS_ON_UNSIGNED
237#if !defined ARCH_PRAGMA_INSTANTIATION_AFTER_SPECIALIZATION
238 #define ARCH_PRAGMA_INSTANTIATION_AFTER_SPECIALIZATION
241#if !defined ARCH_PRAGMA_UNDEFINED_VAR_TEMPLATE
242 #define ARCH_PRAGMA_UNDEFINED_VAR_TEMPLATE
245#if !defined ARCH_PRAGMA_INSTANCE_METHOD_NOT_FOUND
246 #define ARCH_PRAGMA_INSTANCE_METHOD_NOT_FOUND