forked from DFHack/dfhack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDataStatics.cpp
More file actions
32 lines (25 loc) · 823 Bytes
/
DataStatics.cpp
File metadata and controls
32 lines (25 loc) · 823 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include "Core.h"
#include "Internal.h"
#include "DataDefs.h"
#include "MiscUtils.h"
#include "VersionInfo.h"
#include "df/world.h"
#include "df/world_data.h"
#include "df/plotinfost.h"
#include "DataIdentity.h"
namespace {
template<class T>
inline T *_toptr(T &r) { return &r; }
template<class T>
inline T *_toptr(T *&p) { return p; }
}
#define _fieldptr(ptr, fn) (ptr) ? _toptr((ptr)->fn) : NULL
#define INIT_GLOBAL_FUNCTION_PREFIX \
DFHack::VersionInfo *global_table_ = DFHack::Core::getInstance().vinfo.get(); \
void * tmp_;
#define INIT_GLOBAL_FUNCTION_ITEM(type,name) \
if (global_table_->getAddress(#name,tmp_)) name = (type*)tmp_;
#define TID(type) (&identity_traits< type >::identity)
// Instantiate all the static objects
#include "df/static.inc"
#include "df/static.enums.inc"