1
0
mirror of https://https.git.savannah.gnu.org/git/gnulib.git synced 2026-09-01 02:34:55 +00:00
Files
gnulib/tests/test-gettext-h.c
Paul Eggert a9fa600521 gettext-h: always define textdomain
Problem reported by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2026-08/msg00288.html
* lib/gettext.h (textdomain, bindtextdomain, bind_textdomain_codeset)
[!ENABLE_NLS && __GNUC__ && !__clang__ && !__cplusplus]:
Define to no-ops in this case too.
Move the definition of _LIBGETTEXT_FUNCAST up one level of
ifdeffery so that it is defined for this case.
* tests/test-gettext-h.c (main) [!ENABLE_NLS]: Call textdomain,
reverting the previous change to this file.
2026-08-25 13:27:28 -07:00

42 lines
1.1 KiB
C

/* Test of gettext.h convenience header.
Copyright (C) 2024-2026 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"
#include <string.h>
int
main (void)
{
const char *s;
textdomain ("tzlof");
s = gettext ("some text");
if (!streq (s, "some text"))
return 1;
s = pgettext ("menu", "some other text");
if (!streq (s, "some other text"))
return 1;
return 0;
}