GCC Middle and Back End API Reference
intl.h
Go to the documentation of this file.
1/* intl.h - internationalization
2 Copyright (C) 1998-2026 Free Software Foundation, Inc.
3
4 GCC is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 3, or (at your option)
7 any later version.
8
9 GCC is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with GCC; see the file COPYING3. If not see
16 <http://www.gnu.org/licenses/>. */
17
18#ifndef GCC_INTL_H
19#define GCC_INTL_H
20
21#include <locale.h>
22
23#ifndef HAVE_SETLOCALE
24# define setlocale(category, locale) (locale)
25#endif
26
27#ifdef ENABLE_NLS
28#include <libintl.h>
29extern void gcc_init_libintl (void);
30extern size_t gcc_gettext_width (const char *);
31#else
32/* Stubs. */
33# undef textdomain
34# define textdomain(domain) (domain)
35# undef bindtextdomain
36# define bindtextdomain(domain, directory) (domain)
37# undef gettext
38# define gettext(msgid) (msgid)
39# define ngettext(singular,plural,n) fake_ngettext (singular, plural, n)
40# define gcc_init_libintl() /* nothing */
41# define gcc_gettext_width(s) strlen (s)
42
43extern const char *fake_ngettext (const char *singular, const char *plural,
44 unsigned long int n);
45
46#endif
47
48/* Used to immediately translate the argument. */
49#ifndef _
50# define _(msgid) gettext (msgid)
51#endif
52
53/* Used to mark strings that will be translated later. */
54#ifndef N_
55# define N_(msgid) msgid
56#endif
57
58/* Like N_, but for GCC diagnostic format strings. See ABOUT-GCC-NLS for
59 details. */
60#ifndef G_
61# define G_(gmsgid) gmsgid
62#endif
63
64extern char *get_spaces (const char *);
65
66extern const char *open_quote;
67extern const char *close_quote;
68extern const char *locale_encoding;
69extern bool locale_utf8;
70
71#endif /* intl.h */
const char * open_quote
Definition intl.cc:30
const char * close_quote
Definition intl.cc:33
bool locale_utf8
Definition intl.cc:39
const char * locale_encoding
Definition intl.cc:36
const char * fake_ngettext(const char *singular, const char *plural, unsigned long n)
Definition intl.cc:125
char * get_spaces(const char *str)
Definition intl.cc:140
#define gcc_gettext_width(s)
Definition intl.h:41
#define gcc_init_libintl()
Definition intl.h:40