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 \"-Wunused-variable\"") \
43  _Pragma("GCC diagnostic ignored \"-Wsign-conversion\"") \
44  _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
45 #else
46 #define TESSERACT_COMMON_IGNORE_WARNINGS_PUSH \
47  _Pragma("GCC diagnostic push") _Pragma("GCC diagnostic ignored \"-Wall\"") \
48  _Pragma("GCC diagnostic ignored \"-Wint-to-pointer-cast\"") \
49  _Pragma("GCC diagnostic ignored \"-Wunused-parameter\"") \
50  _Pragma("GCC diagnostic ignored \"-Wsuggest-override\"") \
51  _Pragma("GCC diagnostic ignored \"-Wconversion\"") \
52  _Pragma("GCC diagnostic ignored \"-Wfloat-conversion\"") \
53  _Pragma("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") \
54  _Pragma("GCC diagnostic ignored \"-Wunused-variable\"") \
55  _Pragma("GCC diagnostic ignored \"-Wclass-memaccess\"") \
56  _Pragma("GCC diagnostic ignored \"-Wsign-conversion\"") \
57  _Pragma("GCC diagnostic ignored \"-Wstringop-overflow\"") \
58  _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
59 #endif
60 
61 #define TESSERACT_COMMON_IGNORE_WARNINGS_POP \
62  _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


tesseract_common
Author(s): Levi Armstrong
autogenerated on Sun May 18 2025 03:01:40