Skip to content

Commit

Permalink
add stdint to generated files, close #50
Browse files Browse the repository at this point in the history
  • Loading branch information
Aurel300 committed Sep 17, 2021
1 parent f6c50d9 commit 2a2fe1e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
3 changes: 2 additions & 1 deletion src/ammer/stub/StubCpp.hx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ class StubCpp {
static var lb:LineBuf;

static function generateHeader():Void {
lb.ai("#include <stdint.h>\n");
for (header in library.headers)
lb.a('#include <${header}>\n');
lb.ai('#include <${header}>\n');
}

static function mapTypeC(t:FFIType, name:String, closure:Bool = false):String {
Expand Down
7 changes: 4 additions & 3 deletions src/ammer/stub/StubHl.hx
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ class StubHl {
static var lb:LineBuf;

static function generateHeader():Void {
lb.a('#define HL_NAME(n) ammer_${library.name}_ ## n\n');
lb.a('#include <hl.h>\n');
lb.ai('#define HL_NAME(n) ammer_${library.name}_ ## n\n');
lb.ai("#include <stdint.h>\n");
lb.ai("#include <hl.h>\n");
for (header in library.headers)
lb.a('#include <${header}>\n');
lb.ai('#include <${header}>\n');
}

static function mapTypeHlFFI(t:FFIType):String {
Expand Down
7 changes: 4 additions & 3 deletions src/ammer/stub/StubLua.hx
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ class StubLua {
lb.ai("#ifdef __cplusplus\n");
lb.ai("extern \"C\" {\n");
lb.ai("#endif\n");
lb.ai('#include <lua.h>\n');
lb.ai('#include <lualib.h>\n');
lb.ai('#include <lauxlib.h>\n');
lb.ai("#include <stdint.h>\n");
lb.ai("#include <lua.h>\n");
lb.ai("#include <lualib.h>\n");
lb.ai("#include <lauxlib.h>\n");
lb.ai("#ifdef __cplusplus\n");
lb.ai("}\n");
lb.ai("#endif\n");
Expand Down

0 comments on commit 2a2fe1e

Please sign in to comment.