X-Git-Url: http://git.draconx.ca/gitweb/dxcommon.git/blobdiff_plain/02e6afe4c4956fd667dfefc04e8f129b5b84f709..262d3eaea39294df3f6172b28213e927e2f3b424:/t/nls/gettext.h diff --git a/t/nls/gettext.h b/t/nls/gettext.h index b8a8060..8392992 100644 --- a/t/nls/gettext.h +++ b/t/nls/gettext.h @@ -11,7 +11,27 @@ #ifndef TEST_NLS_GETTEXT_H_ #define TEST_NLS_GETTEXT_H_ +#include +#include + #define gettext(s) (s) #define pgettext_expr(a, s) (s) +/* + * We don't need a real snprintf for testing help functionality; substitute + * using vsprintf to ease testing on C89 implementations. + */ +#define help_do_snprintf help_do_snprintf +static inline int help_do_snprintf(char *buf, size_t n, const char *fmt, ...) +{ + va_list ap; + int ret; + + va_start(ap, fmt); + ret = vsprintf(buf, fmt, ap); + va_end(ap); + + return ret; +} + #endif