Browse Source

ref_gl: use GCC provided offsetof implementation

pull/2/head
Alibek Omarov 3 years ago
parent
commit
7bcfce5a7a
  1. 6
      ref_gl/gl_local.h
  2. 4
      ref_soft/r_local.h

6
ref_gl/gl_local.h

@ -36,8 +36,12 @@ GNU General Public License for more details.
#include "wadfile.h" #include "wadfile.h"
#ifndef offsetof #ifndef offsetof
#ifdef __GNUC__
#define offsetof(s,m) __builtin_offsetof(s,m)
#else
#define offsetof(s,m) (size_t)&(((s *)0)->m) #define offsetof(s,m) (size_t)&(((s *)0)->m)
#endif // offsetof #endif
#endif
#define ASSERT(x) if(!( x )) gEngfuncs.Host_Error( "assert failed at %s:%i\n", __FILE__, __LINE__ ) #define ASSERT(x) if(!( x )) gEngfuncs.Host_Error( "assert failed at %s:%i\n", __FILE__, __LINE__ )
#define Assert(x) if(!( x )) gEngfuncs.Host_Error( "assert failed at %s:%i\n", __FILE__, __LINE__ ) #define Assert(x) if(!( x )) gEngfuncs.Host_Error( "assert failed at %s:%i\n", __FILE__, __LINE__ )

4
ref_soft/r_local.h

@ -36,10 +36,6 @@ typedef struct mip_s mip_t;
typedef int fixed8_t; typedef int fixed8_t;
typedef int fixed16_t; typedef int fixed16_t;
#ifndef offsetof
#define offsetof(s,m) (size_t)&(((s *)0)->m)
#endif // offsetof
#define ASSERT(x) if(!( x )) gEngfuncs.Host_Error( "assert failed at %s:%i\n", __FILE__, __LINE__ ) #define ASSERT(x) if(!( x )) gEngfuncs.Host_Error( "assert failed at %s:%i\n", __FILE__, __LINE__ )
#define Assert(x) if(!( x )) gEngfuncs.Host_Error( "assert failed at %s:%i\n", __FILE__, __LINE__ ) #define Assert(x) if(!( x )) gEngfuncs.Host_Error( "assert failed at %s:%i\n", __FILE__, __LINE__ )

Loading…
Cancel
Save