Skip to content

Commit

Permalink
web include dir was broken..fixed!
Browse files Browse the repository at this point in the history
  • Loading branch information
thradams committed Oct 4, 2024
1 parent 4cffb68 commit bf838fb
Show file tree
Hide file tree
Showing 6 changed files with 6,839 additions and 6,850 deletions.
2 changes: 1 addition & 1 deletion src/file.c
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#define F(a,...
#include <math.h>
18 changes: 12 additions & 6 deletions src/lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -3585,8 +3585,9 @@ struct include_dir* _Opt include_dir_add(struct include_dir_list* list, const ch

static void pragma_once_add(struct preprocessor_ctx* ctx, const char* path)
{
assert(path_is_absolute(path));
assert(path_is_normalized(path));
//FAILING ON EMSCRIPT
//assert(path_is_absolute(path));
//assert(path_is_normalized(path));
struct hash_item_set item = { 0 };
item.number = 1;
hashmap_set(&ctx->pragma_once_map, path, &item /*in out*/);
Expand All @@ -3595,8 +3596,9 @@ static void pragma_once_add(struct preprocessor_ctx* ctx, const char* path)

static bool pragma_once_already_included(struct preprocessor_ctx* ctx, const char* path)
{
assert(path_is_absolute(path));
assert(path_is_normalized(path));
//FAILING ON EMSCRIPT
//assert(path_is_absolute(path));
//assert(path_is_normalized(path));
return hashmap_find(&ctx->pragma_once_map, path) != NULL;
}

Expand Down Expand Up @@ -8232,7 +8234,11 @@ void add_standard_macros(struct preprocessor_ctx* ctx)
"#define __STDC_OWNERSHIP__ 1\n"
"#define _W_DIVIZION_BY_ZERO_ 29\n"



#ifdef __EMSCRIPTEN__
//include dir on emscripten
"#pragma dir \"c:/\"\n"
#endif

#ifdef _WIN32

Expand Down Expand Up @@ -26719,7 +26725,7 @@ void format_visit(struct format_visit_ctx* ctx);

//#pragma once

#define CAKE_VERSION "0.9.26"
#define CAKE_VERSION "0.9.27"



Expand Down
11 changes: 11 additions & 0 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,17 @@ int main(int argc, char** argv)
{
enable_vt_mode();

#if 0
//Help debug emscript on desktop
//MOCKFILES needs to be defined
const char* source =
"#include <stdio.h>\n";

char* _Owner _Opt r =
CompileText("", source);
return;
#endif

//-msvc-output

/*
Expand Down
16 changes: 11 additions & 5 deletions src/tokenizer.c
Original file line number Diff line number Diff line change
Expand Up @@ -374,8 +374,9 @@ struct include_dir* _Opt include_dir_add(struct include_dir_list* list, const ch

static void pragma_once_add(struct preprocessor_ctx* ctx, const char* path)
{
assert(path_is_absolute(path));
assert(path_is_normalized(path));
//FAILING ON EMSCRIPT
//assert(path_is_absolute(path));
//assert(path_is_normalized(path));
struct hash_item_set item = { 0 };
item.number = 1;
hashmap_set(&ctx->pragma_once_map, path, &item /*in out*/);
Expand All @@ -384,8 +385,9 @@ static void pragma_once_add(struct preprocessor_ctx* ctx, const char* path)

static bool pragma_once_already_included(struct preprocessor_ctx* ctx, const char* path)
{
assert(path_is_absolute(path));
assert(path_is_normalized(path));
//FAILING ON EMSCRIPT
//assert(path_is_absolute(path));
//assert(path_is_normalized(path));
return hashmap_find(&ctx->pragma_once_map, path) != NULL;
}

Expand Down Expand Up @@ -5021,7 +5023,11 @@ void add_standard_macros(struct preprocessor_ctx* ctx)
"#define __STDC_OWNERSHIP__ 1\n"
"#define _W_DIVIZION_BY_ZERO_ 29\n"



#ifdef __EMSCRIPTEN__
//include dir on emscripten
"#pragma dir \"c:/\"\n"
#endif

#ifdef _WIN32

Expand Down
2 changes: 1 addition & 1 deletion src/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@

#pragma once

#define CAKE_VERSION "0.9.26"
#define CAKE_VERSION "0.9.27"

13,640 changes: 6,803 additions & 6,837 deletions src/web/cake.js

Large diffs are not rendered by default.

0 comments on commit bf838fb

Please sign in to comment.