FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
daScript/include/daScript/daScriptModule.h at master · PushoN/daScript · GitHub
PushoN
/
daScript
Public
forked from
GaijinEntertainment/daScript
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
daScript
/
include
/
daScript
/
daScriptModule.h
Copy path
More file actions
More file actions
Latest commit
History
History
History
93 lines (79 loc) · 2.85 KB
Breadcrumbs
daScript
/
include
/
daScript
/
daScriptModule.h
Copy path
File metadata and controls
93 lines (79 loc) · 2.85 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#
pragma
once
#
include
"
daScript/misc/platform.h
"
//
DAS_THREAD_LOCAL
namespace
das
{
inline
DAS_THREAD_LOCAL
(
unsigned
) ModuleKarma;
class
Module
;
//
This function registers all builtin modules.
//
Builtin modules are modules listed in /src/builtin/
//
Note: this is similar to NEED_ALL_DEFAULT_MODULES
//
but more safe, since it allows such modules to be
//
already registered.
DAS_API
void
register_builtin_modules
();
};
#
define
NEED_MODULE
(
ClassName
) \
extern
DAS_API
das::Module * register_##ClassName (); \
*das::ModuleKarma +=
unsigned
(
intptr_t
(register_##ClassName()));
#
define
NEED_FUSION
\
{
extern
DAS_CC_API
void
register_fusion
();
register_fusion
(); }
#
define
NEED_ALL_DEFAULT_MODULES
\
NEED_MODULE
(Module_BuiltIn); \
NEED_MODULE
(Module_Math); \
NEED_MODULE
(Module_Strings); \
NEED_MODULE
(Module_Rtti); \
NEED_MODULE
(Module_Ast); \
NEED_MODULE
(Module_Debugger); \
NEED_MODULE
(Module_Jit); \
NEED_MODULE
(Module_FIO); \
NEED_MODULE
(Module_DASBIND); \
NEED_MODULE
(Module_Network); \
NEED_FUSION
;
//
DECLARE_MODULE / PULL_MODULE — namespace-safe alternatives to NEED_MODULE.
//
//
NEED_MODULE places an `extern` declaration at the current scope, which
//
fails inside a C++ namespace (the linker looks for Namespace::register_…
//
instead of the global-scope function).
//
//
Use DECLARE_MODULE at global/file scope to forward-declare the register
//
function, then PULL_MODULE inside any namespace or function body to call it.
//
//
Example:
//
DECLARE_ALL_DEFAULT_MODULES; // file scope
//
namespace MyApp {
//
void init() {
//
PULL_ALL_DEFAULT_MODULES; // OK — works inside namespace
//
das::Module::Initialize();
//
}
//
}
#
define
DECLARE_MODULE
(
ClassName
) \
extern
DAS_API
das::Module * register_##ClassName ()
#
define
PULL_MODULE
(
ClassName
) \
*das::ModuleKarma +=
unsigned
(
intptr_t
(::register_##ClassName()))
#
define
DECLARE_FUSION
\
extern
DAS_CC_API
void
register_fusion
()
#
define
PULL_FUSION
\
::register_fusion
()
#
define
DECLARE_ALL_DEFAULT_MODULES
\
DECLARE_MODULE
(Module_BuiltIn); \
DECLARE_MODULE
(Module_Math); \
DECLARE_MODULE
(Module_Strings); \
DECLARE_MODULE
(Module_Rtti); \
DECLARE_MODULE
(Module_Ast); \
DECLARE_MODULE
(Module_Debugger); \
DECLARE_MODULE
(Module_Jit); \
DECLARE_MODULE
(Module_FIO); \
DECLARE_MODULE
(Module_DASBIND); \
DECLARE_MODULE
(Module_Network); \
DECLARE_FUSION
#
define
PULL_ALL_DEFAULT_MODULES
\
PULL_MODULE
(Module_BuiltIn); \
PULL_MODULE
(Module_Math); \
PULL_MODULE
(Module_Strings); \
PULL_MODULE
(Module_Rtti); \
PULL_MODULE
(Module_Ast); \
PULL_MODULE
(Module_Debugger); \
PULL_MODULE
(Module_Jit); \
PULL_MODULE
(Module_FIO); \
PULL_MODULE
(Module_DASBIND); \
PULL_MODULE
(Module_Network); \
PULL_FUSION
Back
|
FazBrowse Home
|
New Git URL