Skip to content

Commit d60dce6

Browse files
committed
This needs to be here because when compiling projects that have HL2_EPISODIC define it gives me "cannot apply 'offsetof' when 'operator[]' is overloaded" error on Linux in hl2_player.cpp on line 436 and 437. It seems like it uses offsetof from the standard library for absolutely unknown reason.
1 parent c37b70d commit d60dce6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

sp/src/game/server/hl2/hl2_player.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@
4949

5050
#ifdef HL2_EPISODIC
5151
#include "npc_alyx_episodic.h"
52+
#ifdef LINUX
53+
#undef offsetof
54+
#define offsetof(s,m) (size_t)&(((s *)0)->m)
55+
#endif
5256
#endif
5357

5458
#ifdef PORTAL

0 commit comments

Comments
 (0)