2024-11-24 Bruno Haible <bruno@clisp.org>
+ gettext-h: Add tests.
+ Suggested by Ben Pfaff <blp@cs.stanford.edu> in
+ <https://lists.gnu.org/archive/html/bug-gnulib/2024-11/msg00186.html>.
+ * tests/test-gettext-h.c: New file.
+ * modules/gettext-h-tests: New file.
+
gettext-h: Fix compilation error when pgettext is used.
Reported by Friedrich Beckmann <friedrich.beckmann@posteo.de> in
<https://lists.gnu.org/archive/html/bug-gnulib/2024-11/msg00189.html>.
--- /dev/null
+/* Test of gettext.h convenience header.
+ Copyright (C) 2024 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2024. */
+
+#include <config.h>
+
+#include "gettext.h"
+
+int
+main (void)
+{
+ const char *s;
+
+ textdomain ("tzlof");
+
+ s = gettext ("some text");
+ s = pgettext ("menu", "some other text");
+
+ return 0;
+}