FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

daScriptModule.h · Xsankor/daScript@24a3947 · GitHub

Repository navigation

Commit 24a3947

Browse files
Aliot
committed
daScriptModule.h
This allows to get dependency anywhere for daScript without heavy header daScript.h .
1 parent a6c691a commit 24a3947

5 files changed

Lines changed: 14 additions & 7 deletions

File tree

‎CMakeLists.txt‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ SOURCE_GROUP_FILES("simulate" SIMULATE_SRC)
172172

173173
SET(MAIN_SRC
174174
include/daScript/daScript.h
175+
include/daScript/daScriptModule.h
175176
include/daScript/das_config.h
176177
)
177178
SOURCE_GROUP_FILES("main" MAIN_SRC)

‎include/daScript/ast/ast.h‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1566,8 +1566,6 @@ namespace das
15661566
mutable map<string, ExprCallFactory> callThis;
15671567
string name;
15681568
bool builtIn = false;
1569-
public:
1570-
static intptr_t Karma;
15711569
private:
15721570
Module * next = nullptr;
15731571
static Module * modules;
@@ -1586,10 +1584,6 @@ namespace das
15861584
return module_##ClassName; \
15871585
}
15881586

1589-
#define NEED_MODULE(ClassName) \
1590-
extern das::Module * register_##ClassName (); \
1591-
das::Module::Karma += intptr_t(register_##ClassName());
1592-
15931587
class ModuleLibrary {
15941588
friend class Module;
15951589
friend class Program;

‎include/daScript/daScript.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#pragma once
22

3+
#include <daScript/daScriptModule.h>
34
#include <daScript/misc/platform.h>
45
#include <daScript/ast/ast.h>
56
#include <daScript/ast/ast_interop.h>

‎include/daScript/daScriptModule.h‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#pragma once
2+
namespace das
3+
{
4+
extern intptr_t ModuleKarma;
5+
class Module;
6+
};
7+
8+
#define NEED_MODULE(ClassName) \
9+
extern das::Module * register_##ClassName (); \
10+
das::ModuleKarma += intptr_t(register_##ClassName());

‎src/ast/ast_module.cpp‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
namespace das {
66

7+
intptr_t ModuleKarma = 0;
8+
79
bool splitTypeName ( const string & name, string & moduleName, string & funcName ) {
810
auto at = name.find("::");
911
if ( at!=string::npos ) {
@@ -33,7 +35,6 @@ namespace das {
3335

3436
// MODULE
3537

36-
intptr_t Module::Karma = 0;
3738
Module * Module::modules = nullptr;
3839

3940
TypeAnnotation * Module::resolveAnnotation ( TypeInfo * info ) {

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL