8 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7))
9 #define znoreturn __attribute__((__noreturn__))
10 #define zprintflike(f, a) __attribute__((__format__(__printf__, f, a)))
13 #define zprintflike(f, a)
16 #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1))
17 #define zexternally_visible __attribute__((__externally_visible__))
19 #define zexternally_visible
22 #ifndef ZTERP_NO_SAFETY_CHECKS
23 extern unsigned long zassert_pc;
24 #define ZPC(pc) do { zassert_pc = pc; } while(0)
28 void assert_fail(const char *, ...);
29 #define ZASSERT(expr, ...) do { if(!(expr)) assert_fail(__VA_ARGS__); } while(0)
31 #define ZPC(pc) ((void)0)
32 #define ZASSERT(expr, ...) ((void)0)
36 void warning(const char *, ...);
40 void die(const char *, ...);
42 char *xstrdup(const char *);
43 int process_arguments(int, char **);
45 /* Somewhat ugly hack to get around the fact that some Glk functions may
46 * not exist. These function calls should all be guarded (e.g.
47 * if(have_unicode), with have_unicode being set iff GLK_MODULE_UNICODE
48 * is defined) so they will never be called if the Glk implementation
49 * being used does not support them, but they must at least exist to
50 * prevent link errors.
53 #ifndef GLK_MODULE_UNICODE
54 #define glk_put_char_uni(...) die("bug %s:%d: glk_put_char_uni() called with no unicode", __FILE__, __LINE__)
55 #define glk_put_string_uni(...) die("bug %s:%d: glk_put_string_uni() called with no unicode", __FILE__, __LINE__)
56 #define glk_request_char_event_uni(...) die("bug %s:%d: glk_request_char_event_uni() called with no unicode", __FILE__, __LINE__)
57 #define glk_request_line_event_uni(...) die("bug %s:%d: glk_request_line_event_uni() called with no unicode", __FILE__, __LINE__)
59 #ifndef GLK_MODULE_LINE_ECHO
60 #define glk_set_echo_line_event(...) die("bug: %s %d: glk_set_echo_line_event() called with no line echo", __FILE__, __LINE__)