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
41e9af392f
commit
c1c3f9d00e
@ -120,10 +120,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 SIZE_OF_ARRAY(p) _ARRAYSIZE(p)
|
||||
|
||||
|
@ -28,10 +28,6 @@
|
||||
#include "localflexcontroller.h"
|
||||
|
||||
|
||||
#ifndef offsetof
|
||||
#define offsetof(s,m) (size_t)&(((s *)0)->m)
|
||||
#endif
|
||||
|
||||
#define STUDIO_ENABLE_PERF_COUNTERS
|
||||
|
||||
#define STUDIO_SEQUENCE_ACTIVITY_LOOKUPS_ARE_SLOW 0
|
||||
|
@ -252,6 +252,17 @@ 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
|
||||
|
||||
|
||||
#define ALIGN_VALUE( val, alignment ) ( ( val + alignment - 1 ) & ~( alignment - 1 ) ) // need macro for constant expression
|
||||
|
||||
// Used to step into the debugger
|
||||
|
@ -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