]> git.draconx.ca Git - dxcommon.git/blobdiff - t/nls/gettext.h
help_print_optstring: New table-based implementation.
[dxcommon.git] / t / nls / gettext.h
index 83929924f718ccde6bcb58fb095618f218b085bc..95bdf14152d29aceb16ed5fd18c58ba8dba5f3cf 100644 (file)
@@ -14,9 +14,6 @@
 #include <stdio.h>
 #include <stdarg.h>
 
-#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.
@@ -34,4 +31,11 @@ static inline int help_do_snprintf(char *buf, size_t n, const char *fmt, ...)
        return ret;
 }
 
+/*
+ * Do nothing, but try to tickle a crash if a bogus string argument is
+ * passed as the real functions dereference the provided pointers.
+ */
+#define gettext(s) (*(volatile char *)s, s)
+#define pgettext_expr(c, s) (*(volatile char *)c + *(volatile char *)s, s)
+
 #endif