diff --git a/6.0s1.h b/6.0s1.h index fe1ff54..597d5fc 100644 --- a/6.0s1.h +++ b/6.0s1.h @@ -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); }