cbase: Undef offsetof if present

Fixes Linux builds in SDK.
This commit is contained in:
Joshua Ashton 2022-09-02 16:58:58 +00:00 committed by Joshie
parent cf10810b35
commit 08c0934acc
1 changed files with 14 additions and 0 deletions

View File

@ -9,6 +9,20 @@
// Tier0 // Tier0
#include "tier0/basetypes.h" #include "tier0/basetypes.h"
#include "tier0/dbg.h" #include "tier0/dbg.h"
// Workaround mem.h #defining offsetof
// on public SDKs when on Linux.
// We don't want this behaviour.
#ifdef LINUX
#define WAS_LINUX
#undef LINUX
#endif
#include "tier0/mem.h"
#ifdef WAS_LINUX
#define LINUX
#undef WAS_LINUX
#endif
#ifndef GAME_SDK2013 #ifndef GAME_SDK2013
#include "tier0/logging.h" #include "tier0/logging.h"
#endif #endif