-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathModuleExports.h
More file actions
60 lines (46 loc) · 1.43 KB
/
ModuleExports.h
File metadata and controls
60 lines (46 loc) · 1.43 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#pragma once
#ifndef _X_ENGINE_MOUDLE_EXPORTS_H_
#define _X_ENGINE_MOUDLE_EXPORTS_H_
#include <Core\Platform.h>
#include <icore.h>
#include <Extension\FactoryRegNode.h>
#include <Extension\IEngineFactoryRegistryImpl.h>
#include <Debugging\InvalidParameterHandler.h>
#include <Debugging\PureVirtualFunctionCallHandler.h>
#include <Debugging\AbortHandler.h>
// #include <Debugging\SymbolResolution.h>
#if defined(X_LIB) && !defined(_LAUNCHER)
extern CoreGlobals* gEnv;
#else // !X_LIB
CoreGlobals* gEnv = nullptr;
#if !defined(X_LIB)
struct XRegFactoryNode* g_pHeadToRegFactories = nullptr;
#endif
#if defined(_LAUNCHER)
extern "C" void LinkModule(ICore* pCore, const char* moduleName)
#else
extern "C" DLL_EXPORT void LinkModule(ICore* pCore, const char* moduleName)
#endif
{
X_UNUSED(moduleName);
// core::symbolResolution::Startup();
#ifndef X_NO_DEBUG_HANDLERS
core::invalidParameterHandler::Startup();
core::pureVirtualFunctionCallHandler::Startup();
core::abortHandler::Startup();
#endif // X_NO_DEBUG_HANDLERS
if (gEnv) { // Already registered.
return;
}
if (pCore) {
gEnv = pCore->GetGlobalEnv();
}
#if !defined(X_LIB)
if (pCore) {
IEngineFactoryRegistryImpl* pGoatFactoryImpl = static_cast<IEngineFactoryRegistryImpl*>(pCore->GetFactoryRegistry());
pGoatFactoryImpl->RegisterFactories(g_pHeadToRegFactories);
}
#endif
}
#endif // X_LIB
#endif // _X_ENGINE_MOUDLE_EXPORTS_H_