更新 6.0s1.h

This commit is contained in:
rabix 2024-06-07 09:31:06 +08:00
parent e6a7546f3e
commit aa6ed1d04e
1 changed files with 7 additions and 1 deletions

View File

@ -27,6 +27,12 @@ void s1_assert(int value, const char *reason, struct s1_location loc) {
}
}
void s1_trace(const char *text, struct s1_location loc) {
fprintf(stderr, "Trace: %s:%d: %s\n", loc.file, loc.line, text);
}
#define s1_trace(text) s1_trace(text, S1_LOC())
// 2. simple IO
@ -41,7 +47,7 @@ void write_long(S1_LONG value, struct s1_location loc) {
}
void write_double(S1_DOUBLE value, struct s1_location loc) {
int rc = printf("%f", value);
int rc = printf("%lf", value);
s1_assert(rc != EOF, "Error: write_long", loc);
}