mirror of
https://github.com/alliedmodders/hl2sdk.git
synced 2024-12-23 01:59:43 +08:00
Port offsetof "fix" from sdk2013.
This commit is contained in:
parent
f89ee26696
commit
e7165f8f0d
@ -110,10 +110,6 @@ DECLARE_FIELD_SIZE( FIELD_MODELINDEX, sizeof(int) )
|
||||
DECLARE_FIELD_SIZE( FIELD_MATERIALINDEX, sizeof(int) )
|
||||
|
||||
|
||||
#ifndef offsetof
|
||||
#define offsetof(s,m) (size_t)&(((s *)0)->m)
|
||||
#endif
|
||||
|
||||
#define ARRAYSIZE2D(p) (sizeof(p)/sizeof(p[0][0]))
|
||||
|
||||
#define _FIELD(name,fieldtype,count,flags,mapname,tolerance) { fieldtype, #name, { offsetof(classNameTypedef, name), 0 }, count, flags, mapname, NULL, NULL, NULL, sizeof( ((classNameTypedef *)0)->name ), NULL, 0, tolerance }
|
||||
|
@ -23,9 +23,6 @@
|
||||
#include "utlvector.h"
|
||||
|
||||
|
||||
#ifndef offsetof
|
||||
#define offsetof(s,m) (size_t)&(((s *)0)->m)
|
||||
#endif
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
@ -223,6 +223,16 @@ typedef void * HINSTANCE;
|
||||
#define MAX_PATH 260
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef GNUC
|
||||
#undef offsetof
|
||||
//#define offsetof( type, var ) __builtin_offsetof( type, var )
|
||||
#define offsetof(s,m) (size_t)&(((s *)0)->m)
|
||||
#else
|
||||
#undef offsetof
|
||||
#define offsetof(s,m) (size_t)&(((s *)0)->m)
|
||||
#endif
|
||||
|
||||
// Used to step into the debugger
|
||||
#ifdef _WIN32
|
||||
#define DebuggerBreak() __asm { int 3 }
|
||||
|
@ -22,10 +22,6 @@ namespace vgui
|
||||
|
||||
////////////// MESSAGEMAP DEFINITIONS //////////////
|
||||
|
||||
#ifndef offsetof
|
||||
#define offsetof(s,m) (size_t)&(((s *)0)->m)
|
||||
#endif
|
||||
|
||||
#ifndef ARRAYSIZE
|
||||
#define ARRAYSIZE(p) (sizeof(p)/sizeof(p[0]))
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user