Explorar o código

Fixups for par_shaders.

Philip Rideout %!s(int64=6) %!d(string=hai) anos
pai
achega
9e76e9104a
Modificáronse 2 ficheiros con 8 adicións e 1 borrados
  1. 5 1
      par_shaders.h
  2. 3 0
      test/test_cpp.cpp

+ 5 - 1
par_shaders.h

@@ -42,6 +42,7 @@
 extern "C" {
 #endif
 
+#include <stddef.h>
 #include <stdint.h>
 #include <stdbool.h>
 
@@ -84,8 +85,11 @@ void parsh_write_cstring(parsh_context*, parsh_write_line writefn, void* user);
 
 #ifdef PAR_SHADERS_IMPLEMENTATION
 
+#include <assert.h>
 #include <ctype.h>
 #include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
 
 #ifndef PAR_PI
 #define PAR_PI (3.14159265359)
@@ -375,7 +379,7 @@ int main(int argc, char** argv) {
 
     FILE* outfile = fopen(dstfile, "wt");
     fprintf(outfile, "const char SHADERS[] = \n");
-    parsh_write_cstring(context, write_line, outfile);
+    parsh_write_cstring(ctx, write_line, outfile);
     fprintf(outfile, ";\n");
     fclose(outfile);
     parsh_destroy_context(ctx);

+ 3 - 0
test/test_cpp.cpp

@@ -25,6 +25,9 @@
 #define PAR_STREAMLINES_IMPLEMENTATION
 #include "par_streamlines.h"
 
+#define PAR_SHADERS_IMPLEMENTATION
+#include "par_shaders.h"
+
 int main(int argc, char* argv[])
 {
     return 0;