Skip to content

Commit

Permalink
Add cross-platform specifiers for i64/u64
Browse files Browse the repository at this point in the history
  • Loading branch information
mustafaquraish committed Dec 4, 2023
1 parent d06994a commit be6bc7d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions compiler/passes/code_generator.oc
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ def CodeGenerator::gen_format_string_variadic(&this, node: &AST, newline_after:
match expr_type.base {
I8 | I16 | I32 => .out.puts("%d")
U8 | U16 | U32 => .out.puts("%u")
I64 => .out.puts("%lld")
U64 => .out.puts("%llu")
I64 => .out.puts("%\" PRId64 \"")
U64 => .out.puts("%\" PRIu64 \"")
Bool => .out.puts("%s")
F32 | F64 => .out.puts("%f")
Char => .out.puts("%c")
Expand Down
1 change: 1 addition & 0 deletions std/prelude.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <stdarg.h>
#include <string.h>
#include <signal.h>
#include <inttypes.h>

typedef int8_t i8;
typedef int16_t i16;
Expand Down

0 comments on commit be6bc7d

Please sign in to comment.