summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-05-07 02:18:30 +0300
committerAndrei Karas <akaras@inbox.ru>2017-05-07 02:18:30 +0300
commite41d5dee07d1778d53e098de6862fe865798d5fb (patch)
tree9a9de2a0d1293b700f728d98b5e82e9ece658796
parentbd530fb98a1b3b8406396a6b8bc0823bf211f72d (diff)
downloadmanaverse-e41d5dee07d1778d53e098de6862fe865798d5fb.tar.gz
manaverse-e41d5dee07d1778d53e098de6862fe865798d5fb.tar.bz2
manaverse-e41d5dee07d1778d53e098de6862fe865798d5fb.tar.xz
manaverse-e41d5dee07d1778d53e098de6862fe865798d5fb.zip
Add possible SDL warning fix with gcc snapshot.
-rw-r--r--src/localconsts.h8
-rw-r--r--src/net/ea/network.h6
-rw-r--r--src/net/ipc.h6
-rw-r--r--src/net/sdltcpnet.cpp12
-rw-r--r--src/utils/dumplibs.cpp6
-rw-r--r--src/utils/dumplibs_unittest.cc6
6 files changed, 26 insertions, 18 deletions
diff --git a/src/localconsts.h b/src/localconsts.h
index 9928a8f1d..2a3cf5ea7 100644
--- a/src/localconsts.h
+++ b/src/localconsts.h
@@ -236,6 +236,14 @@
#define CLANG_FALLTHROUGH
#endif // __clang__
+#if GCC_VERSION >= 40000
+#define PRAGMACLANG6GCC(str) _Pragma(#str)
+#elif defined(__clang__) && CLANG_VERSION >= 30800
+#define PRAGMACLANG6GCC(str) _Pragma(#str)
+#else // __clang__
+#define PRAGMACLANG6GCC(str)
+#endif // __clang__
+
#ifdef __GNUC__
#if GCC_VERSION >= 40600
#define PRAGMA45(str) _Pragma(#str)
diff --git a/src/net/ea/network.h b/src/net/ea/network.h
index 71b823633..cd5be69e3 100644
--- a/src/net/ea/network.h
+++ b/src/net/ea/network.h
@@ -25,10 +25,10 @@
#include "net/serverinfo.h"
-PRAGMACLANG6(GCC diagnostic push)
-PRAGMACLANG6(GCC diagnostic ignored "-Wold-style-cast")
+PRAGMACLANG6GCC(GCC diagnostic push)
+PRAGMACLANG6GCC(GCC diagnostic ignored "-Wold-style-cast")
#include "net/sdltcpnet.h"
-PRAGMACLANG6(GCC diagnostic pop)
+PRAGMACLANG6GCC(GCC diagnostic pop)
struct PacketInfo;
diff --git a/src/net/ipc.h b/src/net/ipc.h
index 453bbedcd..4a346e890 100644
--- a/src/net/ipc.h
+++ b/src/net/ipc.h
@@ -23,10 +23,10 @@
#include "localconsts.h"
-PRAGMACLANG6(GCC diagnostic push)
-PRAGMACLANG6(GCC diagnostic ignored "-Wold-style-cast")
+PRAGMACLANG6GCC(GCC diagnostic push)
+PRAGMACLANG6GCC(GCC diagnostic ignored "-Wold-style-cast")
#include "net/sdltcpnet.h"
-PRAGMACLANG6(GCC diagnostic pop)
+PRAGMACLANG6GCC(GCC diagnostic pop)
#include <string>
#include <vector>
diff --git a/src/net/sdltcpnet.cpp b/src/net/sdltcpnet.cpp
index fbd852e53..d2cd51c64 100644
--- a/src/net/sdltcpnet.cpp
+++ b/src/net/sdltcpnet.cpp
@@ -41,10 +41,10 @@
#endif // defined __linux__ || defined __linux
-PRAGMACLANG6(GCC diagnostic push)
-PRAGMACLANG6(GCC diagnostic ignored "-Wold-style-cast")
+PRAGMACLANG6GCC(GCC diagnostic push)
+PRAGMACLANG6GCC(GCC diagnostic ignored "-Wold-style-cast")
#include "net/sdltcpnet.h"
-PRAGMACLANG6(GCC diagnostic pop)
+PRAGMACLANG6GCC(GCC diagnostic pop)
#include "debug.h"
@@ -151,10 +151,10 @@ int TcpNet::addSocket(const TcpNet::SocketSet set, const TcpNet::Socket sock)
int TcpNet::socketReady(const TcpNet::Socket sock)
{
- PRAGMACLANG6(GCC diagnostic push)
- PRAGMACLANG6(GCC diagnostic ignored "-Wold-style-cast")
+ PRAGMACLANG6GCC(GCC diagnostic push)
+ PRAGMACLANG6GCC(GCC diagnostic ignored "-Wold-style-cast")
return SDLNet_SocketReady(sock);
- PRAGMACLANG6(GCC diagnostic pop)
+ PRAGMACLANG6GCC(GCC diagnostic pop)
}
int TcpNet::checkSockets(const TcpNet::SocketSet set, const Uint32 timeout)
diff --git a/src/utils/dumplibs.cpp b/src/utils/dumplibs.cpp
index 40e558e4c..959337604 100644
--- a/src/utils/dumplibs.cpp
+++ b/src/utils/dumplibs.cpp
@@ -27,10 +27,10 @@
#include <png.h>
#include <SDL_image.h>
#include <SDL_mixer.h>
-PRAGMACLANG6(GCC diagnostic push)
-PRAGMACLANG6(GCC diagnostic ignored "-Wold-style-cast")
+PRAGMACLANG6GCC(GCC diagnostic push)
+PRAGMACLANG6GCC(GCC diagnostic ignored "-Wold-style-cast")
#include <SDL_net.h>
-PRAGMACLANG6(GCC diagnostic pop)
+PRAGMACLANG6GCC(GCC diagnostic pop)
#include <SDL_ttf.h>
#include <zlib.h>
diff --git a/src/utils/dumplibs_unittest.cc b/src/utils/dumplibs_unittest.cc
index 1833fe714..dfe12dbf9 100644
--- a/src/utils/dumplibs_unittest.cc
+++ b/src/utils/dumplibs_unittest.cc
@@ -26,10 +26,10 @@
#include <SDL_image.h>
#include <SDL_mixer.h>
-PRAGMACLANG6(GCC diagnostic push)
-PRAGMACLANG6(GCC diagnostic ignored "-Wold-style-cast")
+PRAGMACLANG6GCC(GCC diagnostic push)
+PRAGMACLANG6GCC(GCC diagnostic ignored "-Wold-style-cast")
#include <SDL_net.h>
-PRAGMACLANG6(GCC diagnostic pop)
+PRAGMACLANG6GCC(GCC diagnostic pop)
#include <SDL_ttf.h>
#include <zlib.h>