From 9970229ca2bb38041dda0c5765331634be6dc60a Mon Sep 17 00:00:00 2001 From: David Griffith Date: Thu, 27 Apr 2023 21:11:51 -0700 Subject: [PATCH] Clarified a bit on the os_fatal() and os_warn() functions that use va_list. The dumb interface does not use va_list printf functions because I'm not entirely sure if the most primitive of C compilers will support them. For this reason, the core must not call os_fatal() or os_warn() with formatting. For all other interfaces, formatting may be used as long as the implementations of os_fatal() and os_warn() are written to support it. It should be noted here that currently only the SDL interface uses os_warn(). --- src/common/frotz.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/common/frotz.h b/src/common/frotz.h index 112623c..ccae2de 100644 --- a/src/common/frotz.h +++ b/src/common/frotz.h @@ -879,7 +879,6 @@ void os_display_char(zchar); void os_display_string(const zchar *); void os_draw_picture(int, int, int); void os_erase_area(int, int, int, int, int); -void os_fatal(const char *, ...); void os_finish_with_sample(int); int os_font_data(int, int *, int *); void os_init_screen(void); @@ -909,9 +908,15 @@ int os_storyfile_tell(FILE *); int os_string_width(const zchar *); zword os_to_true_colour (int); void os_init_setup(void); -void os_warn(const char *, ...); void os_quit(int); +/* Don't use string expansions from the core! The dumb interface + * doesn't support it for historical reasons. Suuport in the interfaces is + * optional. + */ +void os_fatal(const char *, ...); +void os_warn(const char *, ...); + /** * Called regularly by the interpreter, at least every few instructions * (only when interpreting: e.g., not when waiting for input). -- 2.34.1