Tesseract
Motion Planning Environment
Loading...
Searching...
No Matches
macros.h
Go to the documentation of this file.
1
26#ifndef TESSERACT_COMMON_MACROS_H
27#define TESSERACT_COMMON_MACROS_H
28
29// clang-format off
30#if defined(__GNUC__) || defined(__clang__)
31
32#define DEPRECATED(X) __attribute__((deprecated(X)))
33
34#if defined(__clang__)
35#define TESSERACT_COMMON_IGNORE_WARNINGS_PUSH \
36 _Pragma("GCC diagnostic push") _Pragma("GCC diagnostic ignored \"-Wall\"") \
37 _Pragma("GCC diagnostic ignored \"-Wint-to-pointer-cast\"") \
38 _Pragma("GCC diagnostic ignored \"-Wunused-parameter\"") \
39 _Pragma("GCC diagnostic ignored \"-Winconsistent-missing-override\"") \
40 _Pragma("GCC diagnostic ignored \"-Wconversion\"") \
41 _Pragma("GCC diagnostic ignored \"-Wfloat-conversion\"") \
42 _Pragma("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") \
43 _Pragma("GCC diagnostic ignored \"-Wunused-variable\"") \
44 _Pragma("GCC diagnostic ignored \"-Wclass-memaccess\"") \
45 _Pragma("GCC diagnostic ignored \"-Wsign-conversion\"") \
46 _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
47#else
48#define TESSERACT_COMMON_IGNORE_WARNINGS_PUSH \
49 _Pragma("GCC diagnostic push") _Pragma("GCC diagnostic ignored \"-Wall\"") \
50 _Pragma("GCC diagnostic ignored \"-Wint-to-pointer-cast\"") \
51 _Pragma("GCC diagnostic ignored \"-Wunused-parameter\"") \
52 _Pragma("GCC diagnostic ignored \"-Wsuggest-override\"") \
53 _Pragma("GCC diagnostic ignored \"-Wconversion\"") \
54 _Pragma("GCC diagnostic ignored \"-Wfloat-conversion\"") \
55 _Pragma("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") \
56 _Pragma("GCC diagnostic ignored \"-Wunused-variable\"") \
57 _Pragma("GCC diagnostic ignored \"-Wclass-memaccess\"") \
58 _Pragma("GCC diagnostic ignored \"-Wsign-conversion\"") \
59 _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
60#endif
61
62#define TESSERACT_COMMON_IGNORE_WARNINGS_POP _Pragma("GCC diagnostic pop")
63
64#elif defined(_MSC_VER)
65#define DEPRECATED(X) __declspec(deprecated(X))
66#define TESSERACT_COMMON_IGNORE_WARNINGS_PUSH
67#define TESSERACT_COMMON_IGNORE_WARNINGS_POP
68#else
69#pragma message("WARNING: You need to implement MACROS for this compiler")
70#define DEPRECATED(X)
71#define TESSERACT_COMMON_IGNORE_WARNINGS_PUSH
72#define TESSERACT_COMMON_IGNORE_WARNINGS_POP
73#endif
74
75#define UNUSED(x) (void)(x)
76
77// clang-format on
78
79#endif // TESSERACT_COMMON_MACROS_H