diff --git a/builtins.cpp b/builtins.cpp index aabca575..d72bb371 100644 --- a/builtins.cpp +++ b/builtins.cpp @@ -625,7 +625,7 @@ DefineStdlib(SymbolTable *symbolTable, llvm::LLVMContext *ctx, llvm::Module *mod // If the user wants the standard library to be included, parse the // serialized version of the stdlib.ispc file to get its definitions // added. - extern const char *stdlib_code; + extern char stdlib_code[]; yy_scan_string(stdlib_code); yyparse(); } diff --git a/stdlib2cpp.py b/stdlib2cpp.py index c1b7bf1b..132f8257 100755 --- a/stdlib2cpp.py +++ b/stdlib2cpp.py @@ -2,10 +2,11 @@ import sys -print "const char *stdlib_code = " -for line in sys.stdin: - l=line.rstrip() - l=l.replace('"', '\\"') - print "\"" + l + "\\n\"" +print "char stdlib_code[] = { " -print ";" +for line in sys.stdin: + for c in line: + print ord(c) + print ", " + +print "0 };"