summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/localconsts.h6
-rw-r--r--src/mumblemanager.cpp15
2 files changed, 21 insertions, 0 deletions
diff --git a/src/localconsts.h b/src/localconsts.h
index 843e694da..ba2905113 100644
--- a/src/localconsts.h
+++ b/src/localconsts.h
@@ -192,6 +192,12 @@
#define const2 const
+#if GCC_VERSION >= 80000
+#define PRAGMA8(str) _Pragma(#str)
+#else // GCC_VERSION > 80000
+#define PRAGMA8(str)
+#endif // GCC_VERSION > 80000
+
#if GCC_VERSION >= 60000
#define PRAGMA6(str) _Pragma(#str)
#else // GCC_VERSION > 60000
diff --git a/src/mumblemanager.cpp b/src/mumblemanager.cpp
index 27aed89e6..d003cfbbb 100644
--- a/src/mumblemanager.cpp
+++ b/src/mumblemanager.cpp
@@ -189,7 +189,10 @@ void MumbleManager::setPlayer(const std::string &userName)
// (e.g. the ingame Name).
mbstowcs(mLinkedMemCache.identity, userName.c_str(), 256);
mLinkedMemCache.uiTick ++;
+PRAGMA8(GCC diagnostic push)
+PRAGMA8(GCC diagnostic ignored "-Wclass-memaccess")
memcpy(mLinkedMem, &mLinkedMemCache, sizeof(mLinkedMemCache));
+PRAGMA8(GCC diagnostic pop)
}
void MumbleManager::setAction(const int action)
@@ -217,7 +220,10 @@ void MumbleManager::setAction(const int action)
mLinkedMemCache.fCameraPosition[1] = mLinkedMemCache.fAvatarPosition[1];
mLinkedMemCache.uiTick++;
+PRAGMA8(GCC diagnostic push)
+PRAGMA8(GCC diagnostic ignored "-Wclass-memaccess")
memcpy(mLinkedMem, &mLinkedMemCache, sizeof(mLinkedMemCache));
+PRAGMA8(GCC diagnostic pop)
}
void MumbleManager::setPos(const int tileX, const int tileY,
@@ -267,7 +273,10 @@ void MumbleManager::setPos(const int tileX, const int tileY,
}
mLinkedMemCache.uiTick ++;
+PRAGMA8(GCC diagnostic push)
+PRAGMA8(GCC diagnostic ignored "-Wclass-memaccess")
memcpy(mLinkedMem, &mLinkedMemCache, sizeof(mLinkedMemCache));
+PRAGMA8(GCC diagnostic pop)
}
void MumbleManager::setMap(const std::string &mapName)
@@ -293,11 +302,17 @@ void MumbleManager::setServer(const std::string &serverName)
size = sizeof(mLinkedMemCache.context) - 1;
memset(mLinkedMemCache.context, 0, sizeof(mLinkedMemCache.context));
+PRAGMA8(GCC diagnostic push)
+PRAGMA8(GCC diagnostic ignored "-Wclass-memaccess")
memcpy(mLinkedMemCache.context, serverName.c_str(), size);
+PRAGMA8(GCC diagnostic pop)
mLinkedMemCache.context[size] = '\0';
mLinkedMemCache.context_len = size;
mLinkedMemCache.uiTick ++;
+PRAGMA8(GCC diagnostic push)
+PRAGMA8(GCC diagnostic ignored "-Wclass-memaccess")
memcpy(mLinkedMem, &mLinkedMemCache, sizeof(mLinkedMemCache));
+PRAGMA8(GCC diagnostic pop)
}
#endif // USE_MUMBLE