Skip to content

Commit

Permalink
updated from dagor4 repo on 2023/11/07, rev 734cc7c4ec4235531e6273199…
Browse files Browse the repository at this point in the history
…81a91c135d4319f
  • Loading branch information
NicSavichev committed Nov 7, 2023
1 parent 1310ed1 commit fd1eb8e
Show file tree
Hide file tree
Showing 402 changed files with 2,869 additions and 10,444 deletions.
2 changes: 1 addition & 1 deletion DagorEngine.rev.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
15cc17d1f9d3b49624a81f7fbaf7aa63f0dc125d
734cc7c4ec4235531e627319981a91c135d4319f
2 changes: 0 additions & 2 deletions dabuild_all.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,4 @@ popd

pushd samples\testGI\develop
call dabuild.cmd
cd gui
call create_fonts.bat
popd
2 changes: 2 additions & 0 deletions prog/1stPartyLibs/daScript/include/daScript/das_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ using das_safe_set = std::set<K,C>;
#define DAS_BIND_EXTERNAL 1
#elif defined(__linux__)
#define DAS_BIND_EXTERNAL 1
#elif defined __HAIKU__
#define DAS_BIND_EXTERNAL 1
#else
#define DAS_BIND_EXTERNAL 0
#endif
Expand Down
8 changes: 6 additions & 2 deletions prog/1stPartyLibs/daScript/include/daScript/misc/platform.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#pragma once

#ifdef __HAIKU__
#define _GNU_SOURCE 1
#endif

#ifdef _MSC_VER
#pragma warning(disable:4005) // macro redifinition (in flex file)
#pragma warning(disable:4146) // unsigned unary minus
Expand Down Expand Up @@ -75,7 +79,7 @@

#if _TARGET_PC_MACOSX && __SSE__
#define DAS_EVAL_ABI [[clang::vectorcall]]
#elif (defined(_MSC_VER) || defined(__clang__)) && __SSE__
#elif (defined(_MSC_VER) || defined(__clang__)) && __SSE__ && !defined __HAIKU__
#define DAS_EVAL_ABI __vectorcall
#else
#define DAS_EVAL_ABI
Expand Down Expand Up @@ -313,7 +317,7 @@ inline void das_aligned_free16(void *ptr) {
}
#if defined(__APPLE__)
#include <malloc/malloc.h>
#elif defined (__linux__) || defined (_EMSCRIPTEN_VER)
#elif defined (__linux__) || defined (_EMSCRIPTEN_VER) || defined __HAIKU__
#include <malloc.h>
#endif
inline size_t das_aligned_memsize(void * ptr){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ namespace das
static __forceinline vec4f from ( uint64_t x ) { return v_cast_vec4f(v_ldui_half(&x)); }
};

#if defined(__linux__)
#if defined(__linux__) || defined __HAIKU__
template <>
struct cast <long long int> {
static __forceinline long long int to ( vec4f x ) { return v_extract_xi64(v_cast_vec4i(x)); }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace das {
#elif defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#elif defined(__APPLE__)
#elif defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-parameter"
#endif
Expand Down Expand Up @@ -130,7 +130,7 @@ namespace das {
#pragma warning(pop)
#elif defined(__GNUC__)
#pragma GCC diagnostic pop
#elif defined(__APPLE__)
#elif defined(__clang__)
#pragma clang diagnostic pop
#endif
}
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,7 @@ namespace das
vector<FileInfo *> getAllFiles() const;

char * intern ( const char * str );
char * intern ( const char * str, uint32_t len );

void bpcallback ( const LineInfo & at );
void instrumentFunctionCallback ( SimFunction * sim, bool entering, uint64_t userData );
Expand Down
2 changes: 0 additions & 2 deletions prog/1stPartyLibs/daScript/src/ast/ast_aot_cpp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3721,9 +3721,7 @@ namespace das {
ss << "#pragma clang diagnostic ignored \"-Wunused-parameter\"\n";
ss << "#pragma clang diagnostic ignored \"-Wwritable-strings\"\n";
ss << "#pragma clang diagnostic ignored \"-Wunused-variable\"\n";
ss << "#if defined(__APPLE__)\n";
ss << "#pragma clang diagnostic ignored \"-Wunused-but-set-variable\"\n";
ss << "#endif\n";
ss << "#pragma clang diagnostic ignored \"-Wunsequenced\"\n";
ss << "#pragma clang diagnostic ignored \"-Wunused-function\"\n";
ss << "#endif\n";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2093,4 +2093,4 @@ namespace das {
allocateStack(logs);
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ namespace das {
return nullptr;
}
#endif
#elif defined(__linux__)
#elif defined(__linux__) || defined __HAIKU__
void * openGlGetFunctionAddress ( const char * name ) {
auto libName = "libGL.so";
void * libhandle = nullptr;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ char * das::makeNewGuid( das::Context * context, LineInfoArg * at ) {
return res;
}

#elif defined(__linux__) && defined(LINUX_UUID)
#elif defined(__linux__) && defined(LINUX_UUID) || defined __HAIKU__

#include <uuid/uuid.h>

Expand Down
2 changes: 1 addition & 1 deletion prog/1stPartyLibs/daScript/src/hal/performance_time.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ extern "C" int64_t ref_time_delta_to_usec(int64_t ref)
return ref * 1000000LL/freq.QuadPart;
}

#elif __linux__ || defined(_EMSCRIPTEN_VER)
#elif __linux__ || defined(_EMSCRIPTEN_VER) || defined __HAIKU__

#include <time.h>

Expand Down
2 changes: 1 addition & 1 deletion prog/1stPartyLibs/daScript/src/misc/job_que.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ namespace das {
}
}

#elif defined(__linux__)
#elif defined(__linux__) || defined __HAIKU__

#include <pthread.h>

Expand Down
37 changes: 37 additions & 0 deletions prog/1stPartyLibs/daScript/src/misc/sysos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,43 @@
return "";
}
}
#elif defined __HAIKU__
#include <unistd.h>
#include <dlfcn.h>
#include <image.h>
namespace das {
static char executablePath[MAXPATHLEN];
extern "C" void
initialize_before(image_id ourImage)
{
image_info ii;
get_image_info(ourImage, &ii);
snprintf(executablePath, sizeof(executablePath), "%s", ii.name);
}
void hwSetBreakpointHandler ( void (*) ( int, void * ) ) { }
int hwBreakpointSet ( void *, int, int ) {
return -1;
}
bool hwBreakpointClear ( int ) {
return false;
}
size_t getExecutablePathName(char* pathName, size_t pathNameCapacity) {
return snprintf(pathName, pathNameCapacity, "%s", executablePath);
}
void * loadDynamicLibrary ( const char * lib ) {
return dlopen(lib,RTLD_LAZY);
}
void * getFunctionAddress ( void * lib, const char * name ) {
return lib ? dlsym(lib, name) : nullptr;
}
void * getLibraryHandle ( const char * lib ) {
return dlopen(lib,RTLD_LAZY);
}
string normalizeFileName ( const char * fileName ) {
// TODO: implement
return "";
}
}
#else
namespace das {
void hwSetBreakpointHandler ( void (*) ( int, void * ) ) { }
Expand Down
7 changes: 6 additions & 1 deletion prog/1stPartyLibs/daScript/src/simulate/simulate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1195,9 +1195,14 @@ namespace das
});
}

char * Context::intern(const char * str) {
char * Context::intern( const char * str ) {
if ( !str ) return nullptr;
uint32_t len = uint32_t(strlen(str));
return intern(str, len);
}

char * Context::intern ( const char * str, uint32_t len ) {
if ( !str || !len ) return nullptr;
char * ist = constStringHeap->intern(str,len);
if ( !ist ) ist = stringHeap->intern(str,len);
return ist ? ist : stringHeap->allocateString(str,len);
Expand Down
2 changes: 0 additions & 2 deletions prog/1stPartyLibs/daScript/utils/daScript/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,7 @@ bool compile ( const string & fn, const string & cppFn, bool dryRun ) {
tw << "#pragma clang diagnostic ignored \"-Wunused-parameter\"\n";
tw << "#pragma clang diagnostic ignored \"-Wwritable-strings\"\n";
tw << "#pragma clang diagnostic ignored \"-Wunused-variable\"\n";
tw << "#if defined(__APPLE__)\n";
tw << "#pragma clang diagnostic ignored \"-Wunused-but-set-variable\"\n";
tw << "#endif\n";
tw << "#pragma clang diagnostic ignored \"-Wunsequenced\"\n";
tw << "#pragma clang diagnostic ignored \"-Wunused-function\"\n";
tw << "#endif\n";
Expand Down
8 changes: 4 additions & 4 deletions prog/1stPartyLibs/quirrel/quirrel/squirrel/sqast.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ void Node::visitChildren(Visitor *visitor) {
static_cast<ConstDecl *>(this)->visitChildren(visitor); return;
case TO_DECL_GROUP:
static_cast<DeclGroup *>(this)->visitChildren(visitor); return;
case TO_DESTRUCT:
case TO_DESTRUCTURE:
static_cast<DestructuringDecl *>(this)->visitChildren(visitor); return;
case TO_FUNCTION:
static_cast<FunctionDecl *>(this)->visitChildren(visitor); return;
Expand Down Expand Up @@ -216,7 +216,7 @@ void Node::transformChildren(Transformer *transformer) {
static_cast<ConstDecl *>(this)->transformChildren(transformer); return;
case TO_DECL_GROUP:
static_cast<DeclGroup *>(this)->transformChildren(transformer); return;
case TO_DESTRUCT:
case TO_DESTRUCTURE:
static_cast<DestructuringDecl *>(this)->transformChildren(transformer); return;
case TO_FUNCTION:
static_cast<FunctionDecl *>(this)->transformChildren(transformer); return;
Expand Down Expand Up @@ -327,12 +327,12 @@ void CallExpr::transformChildren(Transformer *transformer) {
}

void ArrayExpr::visitChildren(Visitor *visitor) {
for (auto init : initialziers())
for (auto init : initializers())
init->visit(visitor);
}

void ArrayExpr::transformChildren(Transformer *transformer) {
for (auto &init : initialziers())
for (auto &init : initializers())
init = init->transform(transformer)->asExpression();
}

Expand Down
20 changes: 10 additions & 10 deletions prog/1stPartyLibs/quirrel/quirrel/squirrel/sqast.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
DEF_TREE_OP(PARAM), \
DEF_TREE_OP(CONST), \
DEF_TREE_OP(DECL_GROUP), \
DEF_TREE_OP(DESTRUCT), \
DEF_TREE_OP(DESTRUCTURE), \
DEF_TREE_OP(FUNCTION), \
DEF_TREE_OP(CONSTRUCTOR), \
DEF_TREE_OP(CLASS), \
Expand Down Expand Up @@ -221,7 +221,7 @@ class Id : public Expr {
bool isLocal() const { return _outpos == ID_LOCAL; }

SQInteger outerPos() const { return _outpos; }
void setAssiagnable(bool v) { _assignable = v; }
void setAssignable(bool v) { _assignable = v; }
bool isAssignable() const { return _assignable; }
bool isBinding() const { return (isOuter() || isLocal()) && !isAssignable(); }

Expand Down Expand Up @@ -510,8 +510,8 @@ class ArrayExpr : public Expr {
void visitChildren(Visitor *visitor);
void transformChildren(Transformer *transformer);

const ArenaVector<Expr *> &initialziers() const { return _inits; }
ArenaVector<Expr *> &initialziers() { return _inits; }
const ArenaVector<Expr *> &initializers() const { return _inits; }
ArenaVector<Expr *> &initializers() { return _inits; }

private:
ArenaVector<Expr *> _inits;
Expand Down Expand Up @@ -805,7 +805,7 @@ enum DestructuringType {

class DestructuringDecl : public DeclGroup {
public:
DestructuringDecl(Arena *arena, enum DestructuringType dt) : DeclGroup(arena, TO_DESTRUCT), _dt_type(dt), _expr(NULL) {}
DestructuringDecl(Arena *arena, enum DestructuringType dt) : DeclGroup(arena, TO_DESTRUCTURE), _dt_type(dt), _expr(NULL) {}

void visitChildren(Visitor *visitor);
void transformChildren(Transformer *transformer);
Expand All @@ -815,7 +815,7 @@ class DestructuringDecl : public DeclGroup {
setLineEndPos(expr->lineEnd());
setColumnEndPos(expr->columnEnd());
}
Expr *initiExpression() const { return _expr; }
Expr *initExpression() const { return _expr; }

void setType(enum DestructuringType t) { _dt_type = t; }
enum DestructuringType type() const { return _dt_type; }
Expand Down Expand Up @@ -1195,7 +1195,7 @@ class Transformer {
virtual Node *transformConstDecl(ConstDecl *cnst) { return transformDecl(cnst); }
virtual Node *transformEnumDecl(EnumDecl *enm) { return transformDecl(enm); }
virtual Node *transformDeclGroup(DeclGroup *grp) { return transformDecl(grp); }
virtual Node *transformDesctructingDecl(DestructuringDecl *destruct) { return transformDecl(destruct); }
virtual Node *transformDestructuringDecl(DestructuringDecl *destruct) { return transformDecl(destruct); }
};

template<typename V>
Expand Down Expand Up @@ -1294,7 +1294,7 @@ void Node::visit(V *visitor) {
visitor->visitConstDecl(static_cast<ConstDecl *>(this)); return;
case TO_DECL_GROUP:
visitor->visitDeclGroup(static_cast<DeclGroup *>(this)); return;
case TO_DESTRUCT:
case TO_DESTRUCTURE:
visitor->visitDestructuringDecl(static_cast<DestructuringDecl *>(this)); return;
case TO_FUNCTION:
visitor->visitFunctionDecl(static_cast<FunctionDecl *>(this)); return;
Expand Down Expand Up @@ -1409,8 +1409,8 @@ Node *Node::transform(T *transformer) {
return transformer->transformConstDecl(static_cast<ConstDecl *>(this));
case TO_DECL_GROUP:
return transformer->transformDeclGroup(static_cast<DeclGroup *>(this));
case TO_DESTRUCT:
return transformer->transformDesctructingDecl(static_cast<DestructuringDecl *>(this));
case TO_DESTRUCTURE:
return transformer->transformDestructuringDecl(static_cast<DestructuringDecl *>(this));
case TO_FUNCTION:
return transformer->transformFunctionDecl(static_cast<FunctionDecl *>(this));
case TO_CONSTRUCTOR:
Expand Down
8 changes: 4 additions & 4 deletions prog/1stPartyLibs/quirrel/quirrel/squirrel/sqastcodegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,7 @@ void CodegenVisitor::visitDestructuringDecl(DestructuringDecl *destruct) {
_last_pop = -1;
}

visitForceGet(destruct->initiExpression());
visitForceGet(destruct->initExpression());

SQInteger src = _fs->TopTarget();
SQInteger key_pos = _fs->PushTarget();
Expand Down Expand Up @@ -1026,7 +1026,7 @@ void CodegenVisitor::visitLiteralExpr(LiteralExpr *lit) {

void CodegenVisitor::visitArrayExpr(ArrayExpr *expr) {
maybeAddInExprLine(expr);
const auto inits = expr->initialziers();
const auto inits = expr->initializers();

_fs->AddInstruction(_OP_NEWOBJ, _fs->PushTarget(), inits.size(), 0, NOT_ARRAY);

Expand Down Expand Up @@ -1600,7 +1600,7 @@ void CodegenVisitor::visitId(Id *id) {

if ((pos = _fs->GetLocalVariable(idObj, assignable)) != -1) {
_fs->PushTarget(pos);
id->setAssiagnable(assignable);
id->setAssignable(assignable);
}

else if ((pos = _fs->GetOuterVariable(idObj, assignable)) != -1) {
Expand All @@ -1609,7 +1609,7 @@ void CodegenVisitor::visitId(Id *id) {
SQInteger stkPos = _fs->PushTarget();
_fs->AddInstruction(_OP_GETOUTER, stkPos, pos);
}
id->setAssiagnable(assignable);
id->setAssignable(assignable);
}

else if (IsConstant(idObj, constant)) {
Expand Down
Loading

0 comments on commit fd1eb8e

Please sign in to comment.