mirror of
https://github.com/alliedmodders/hl2sdk.git
synced 2025-09-19 20:16:10 +08:00
Port offsetof "fix" from sdk2013.
This commit is contained in:
@ -120,10 +120,6 @@ DECLARE_FIELD_SIZE( FIELD_MODELINDEX, sizeof(int) )
|
|||||||
DECLARE_FIELD_SIZE( FIELD_MATERIALINDEX, 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 ARRAYSIZE2D(p) (sizeof(p)/sizeof(p[0][0]))
|
||||||
#define SIZE_OF_ARRAY(p) _ARRAYSIZE(p)
|
#define SIZE_OF_ARRAY(p) _ARRAYSIZE(p)
|
||||||
|
|
||||||
|
@ -28,10 +28,6 @@
|
|||||||
#include "localflexcontroller.h"
|
#include "localflexcontroller.h"
|
||||||
|
|
||||||
|
|
||||||
#ifndef offsetof
|
|
||||||
#define offsetof(s,m) (size_t)&(((s *)0)->m)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define STUDIO_ENABLE_PERF_COUNTERS
|
#define STUDIO_ENABLE_PERF_COUNTERS
|
||||||
|
|
||||||
#define STUDIO_SEQUENCE_ACTIVITY_LOOKUPS_ARE_SLOW 0
|
#define STUDIO_SEQUENCE_ACTIVITY_LOOKUPS_ARE_SLOW 0
|
||||||
|
@ -252,6 +252,17 @@ typedef void * HINSTANCE;
|
|||||||
#define MAX_PATH 260
|
#define MAX_PATH 260
|
||||||
#endif
|
#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
|
#define ALIGN_VALUE( val, alignment ) ( ( val + alignment - 1 ) & ~( alignment - 1 ) ) // need macro for constant expression
|
||||||
|
|
||||||
// Used to step into the debugger
|
// Used to step into the debugger
|
||||||
|
@ -22,10 +22,6 @@ namespace vgui
|
|||||||
|
|
||||||
////////////// MESSAGEMAP DEFINITIONS //////////////
|
////////////// MESSAGEMAP DEFINITIONS //////////////
|
||||||
|
|
||||||
#ifndef offsetof
|
|
||||||
#define offsetof(s,m) (size_t)&(((s *)0)->m)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef ARRAYSIZE
|
#ifndef ARRAYSIZE
|
||||||
#define ARRAYSIZE(p) (sizeof(p)/sizeof(p[0]))
|
#define ARRAYSIZE(p) (sizeof(p)/sizeof(p[0]))
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user