- eliminate dependency on linking order for autosegs registration

This commit is contained in:
alexey.lysiuk 2020-11-13 11:03:16 +02:00
commit 18b5928f49
14 changed files with 218 additions and 235 deletions

View file

@ -41,6 +41,7 @@
#include "name.h"
#include "palentry.h"
#include "textureid.h"
#include "autosegs.h"
class PClass;
class PType;
@ -134,8 +135,8 @@ public: \
static const size_t PointerOffsets[];
#if defined(_MSC_VER)
# pragma section(".creg$u",read)
# define _DECLARE_TI(cls) __declspec(allocate(".creg$u")) ClassReg * const cls::RegistrationInfoPtr = &cls::RegistrationInfo;
# pragma section(SECTION_CREG,read)
# define _DECLARE_TI(cls) __declspec(allocate(SECTION_CREG)) ClassReg * const cls::RegistrationInfoPtr = &cls::RegistrationInfo;
#else
# define _DECLARE_TI(cls) ClassReg * const cls::RegistrationInfoPtr __attribute__((section(SECTION_CREG))) = &cls::RegistrationInfo;
#endif