Refactor: move static identity_traits to their own file, simplify field defs
DataStaticsFields.cpp used to contain identity_traits specializations for primitive and opaque STL types, as well as macros used for the generated struct field definitions. Only one of these were actually used in any compilation unit, and the identity_traits definitions were hidden behind a guard to prevent them from being compiled at all when building the struct field definitions. Now, the identity_traits specializations live in their own file, DataIdentity.cpp (matching their declarations, which live in DataIdentity.h). This speeds up build times because modifying these specializations no longer requires rebuilding all of the field definitions unnecessarily.develop
parent
d0250ae426
commit
eb12ff17f6
@ -0,0 +1,15 @@
|
|||||||
|
#include <stddef.h>
|
||||||
|
|
||||||
|
#include "DataFuncs.h"
|
||||||
|
|
||||||
|
#ifdef __GNUC__
|
||||||
|
#pragma GCC diagnostic ignored "-Winvalid-offsetof"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define TID(type) (&identity_traits< type >::identity)
|
||||||
|
|
||||||
|
#define FLD(mode, name) struct_field_info::mode, #name, offsetof(CUR_STRUCT, name)
|
||||||
|
#define GFLD(mode, name) struct_field_info::mode, #name, (size_t)&df::global::name
|
||||||
|
#define METHOD(mode, name) struct_field_info::mode, #name, 0, wrap_function(&CUR_STRUCT::name)
|
||||||
|
#define METHOD_N(mode, func, name) struct_field_info::mode, #name, 0, wrap_function(&CUR_STRUCT::func)
|
||||||
|
#define FLD_END struct_field_info::END
|
Loading…
Reference in New Issue