2 * Copyright © 2023 Nick Bowler
4 * Stub gettext macros for test purposes.
6 * License WTFPL2: Do What The Fuck You Want To Public License, version 2.
7 * This is free software: you are free to do what the fuck you want to.
8 * There is NO WARRANTY, to the extent permitted by law.
11 #ifndef TEST_NLS_GETTEXT_H_
12 #define TEST_NLS_GETTEXT_H_
18 * We don't need a real snprintf for testing help functionality; substitute
19 * using vsprintf to ease testing on C89 implementations.
21 #define help_do_snprintf help_do_snprintf
22 static inline int help_do_snprintf(char *buf, size_t n, const char *fmt, ...)
28 ret = vsprintf(buf, fmt, ap);
35 * Do nothing, but try to tickle a crash if a bogus string argument is
36 * passed as the real functions dereference the provided pointers.
38 #define gettext(s) (*(volatile char *)s, s)
39 #define pgettext_expr(c, s) (*(volatile char *)c + *(volatile char *)s, s)