You can use compiler_interface hpp outside
This commit is contained in:
1
base.cpp
1
base.cpp
@@ -1,3 +1,4 @@
|
||||
#define CORE_BASE
|
||||
|
||||
#if defined(__clang__)
|
||||
# define COMPILER_CLANG 1
|
||||
|
||||
@@ -5,8 +5,9 @@ rem cl main.cpp -I.. user32.lib
|
||||
clang core_main.cpp -O0 -Wall -Wno-unused-function -fno-exceptions -fdiagnostics-absolute-paths -g -o main.exe -Wl,user32.lib
|
||||
rem ubuntu run clang core_main.cpp -O0 -Wall -Wno-unused-function -fno-exceptions -fdiagnostics-absolute-paths -g -o core.out
|
||||
|
||||
rem main.exe -testing
|
||||
clang test.cpp
|
||||
|
||||
rem main.exe -testing
|
||||
rem echo Building arms race
|
||||
rem call examples/arms_race/build_arms_race.bat
|
||||
rem main examples/arms_race/arms_race.core
|
||||
|
||||
@@ -11,8 +11,8 @@ struct Ast_Lambda;
|
||||
struct Ast_Type;
|
||||
struct Ast_Expr;
|
||||
|
||||
#ifndef CORE_STRINGS
|
||||
#define CORE_STRINGS
|
||||
#ifndef CORE_BASE
|
||||
#define CORE_BASE
|
||||
struct String{
|
||||
uint8_t *str;
|
||||
int64_t len;
|
||||
@@ -25,6 +25,33 @@ union Intern_String{ // Basically just String
|
||||
int64_t len;
|
||||
};
|
||||
};
|
||||
|
||||
template<class T>
|
||||
struct Array {
|
||||
void *allocator;
|
||||
T *data;
|
||||
int64_t cap;
|
||||
int64_t len;
|
||||
};
|
||||
|
||||
template<class T>
|
||||
struct List_Node{
|
||||
List_Node<T> *next;
|
||||
List_Node<T> *prev;
|
||||
int cap;
|
||||
int len;
|
||||
T data[];
|
||||
};
|
||||
|
||||
template<class T>
|
||||
struct List{
|
||||
int block_size = 0;
|
||||
int allocation_multiplier = 0;
|
||||
List_Node<T> *first = 0;
|
||||
List_Node<T> *last = 0;
|
||||
List_Node<T> *first_free = 0;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
enum Token_Kind{
|
||||
|
||||
Reference in New Issue
Block a user