icculus / mojoshader

Use Direct3D shaders with other 3D rendering APIs.
https://icculus.org/mojoshader/
zlib License
122 stars 36 forks source link

last commit 2021-11-24 fails to build - incomplete function sigs (ctx argument missing) #55

Closed rfht closed 2 years ago

rfht commented 2 years ago

Found the problem while compiling with clang on OpenBSD. The following diff fixed it:

Index: patches/patch-mojoshader_compiler_c
===================================================================
RCS file: patches/patch-mojoshader_compiler_c
diff -N patches/patch-mojoshader_compiler_c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-mojoshader_compiler_c 12 Dec 2021 04:22:44 -0000
@@ -0,0 +1,25 @@
+$OpenBSD$
+
+fix incomplete function signatures
+
+Index: mojoshader_compiler.c
+--- mojoshader_compiler.c.orig
++++ mojoshader_compiler.c
+@@ -475,7 +475,7 @@ static void pop_symbol(Context *ctx, SymbolMap *map)
+     if (!item)
+         return;
+     if (item->symbol)
+-        hash_remove(map->hash, item->symbol);
++        hash_remove(map->hash, item->symbol, ctx);
+     map->scope = item->next;
+     Free(ctx, item);
+ } // pop_symbol
+@@ -524,7 +524,7 @@ static void destroy_symbolmap(Context *ctx, SymbolMap 
+ {
+     while (map->scope)
+         pop_symbol(ctx, map);
+-    hash_destroy(map->hash);
++    hash_destroy(map->hash, ctx);
+ } // destroy_symbolmap
+ 
+ 
flibitijibibo commented 2 years ago

https://github.com/icculus/mojoshader/commit/82b2fc3fe262e082942427d635ded64e237992db