File tree Expand file tree Collapse file tree 2 files changed +39
-2
lines changed Expand file tree Collapse file tree 2 files changed +39
-2
lines changed Original file line number Diff line number Diff line change 35
35
36
36
#include < iostream>
37
37
#include < sstream>
38
+ #include " mysql_util.h"
39
+ DIAGNOSTIC_PUSH
40
+ DISABLE_WARNING (-Wparentheses)
38
41
#include < boost/variant.hpp>
39
42
#include < boost/scoped_array.hpp>
40
-
43
+ DIAGNOSTIC_POP
41
44
#include < cppconn/exception.h>
42
- #include " mysql_util.h"
43
45
#include " mysql_connection.h"
44
46
#include " mysql_statement.h"
45
47
#include " mysql_prepared_statement.h"
Original file line number Diff line number Diff line change 126
126
#define FALLTHROUGH
127
127
#endif
128
128
129
+ /*
130
+ Macros used to disable warnings for fragments of code.
131
+ */
132
+
133
+ #if defined __GNUC__ || defined __clang__
134
+
135
+ #define PRAGMA (X ) _Pragma (#X)
136
+ #define DISABLE_WARNING (W ) PRAGMA(GCC diagnostic ignored #W)
137
+
138
+ #if defined __clang__ || __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
139
+ #define DIAGNOSTIC_PUSH PRAGMA (GCC diagnostic push)
140
+ #define DIAGNOSTIC_POP PRAGMA (GCC diagnostic pop)
141
+ #else
142
+ #define DIAGNOSTIC_PUSH
143
+ #define DIAGNOSTIC_POP
144
+ #endif
145
+
146
+ #elif defined _MSC_VER
147
+
148
+
149
+ #define PRAGMA (X ) __pragma(X)
150
+ #define DISABLE_WARNING (W ) PRAGMA(warning (disable:W))
151
+
152
+ #define DIAGNOSTIC_PUSH PRAGMA (warning (push))
153
+ #define DIAGNOSTIC_POP PRAGMA (warning (pop))
154
+
155
+ #else
156
+
157
+ #define PRAGMA (X )
158
+ #define DISABLE_WARNING (W )
159
+
160
+ #define DIAGNOSTIC_PUSH
161
+ #define DIAGNOSTIC_POP
162
+
163
+ #endif
129
164
130
165
namespace sql
131
166
{
You can’t perform that action at this time.
0 commit comments