PR/56490
[official-gcc.git] / gcc / intl.h
blob5ea5f5b78784a96f47c5c260396e949de056be9f
1 /* intl.h - internationalization
2 Copyright (C) 1998-2013 Free Software Foundation, Inc.
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.
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.
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/>. */
18 #ifndef GCC_INTL_H
19 #define GCC_INTL_H
21 #ifdef HAVE_LOCALE_H
22 # include <locale.h>
23 #endif
25 #ifndef HAVE_SETLOCALE
26 # define setlocale(category, locale) (locale)
27 #endif
29 /* If libintl.h is available, include it before testing for NLS. If we
30 are building with --disable-nls and another header file includes
31 libintl.h, the stubs defined down below will cause syntax errors
32 when parsing libintl.h. See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54281
33 for details. */
34 #if defined(HAVE_LIBINTL_H) || defined(ENABLE_NLS)
35 # include <libintl.h>
36 #endif
38 #ifdef ENABLE_NLS
39 extern void gcc_init_libintl (void);
40 extern size_t gcc_gettext_width (const char *);
41 #else
42 /* Stubs. */
43 # undef textdomain
44 # define textdomain(domain) (domain)
45 # undef bindtextdomain
46 # define bindtextdomain(domain, directory) (domain)
47 # undef gettext
48 # define gettext(msgid) (msgid)
49 # define ngettext(singular,plural,n) fake_ngettext(singular,plural,n)
50 # define gcc_init_libintl() /* nothing */
51 # define gcc_gettext_width(s) strlen(s)
53 extern const char *fake_ngettext(const char *singular,const char *plural,
54 unsigned long int n);
56 #endif
58 #ifndef _
59 # define _(msgid) gettext (msgid)
60 #endif
62 #ifndef N_
63 # define N_(msgid) msgid
64 #endif
66 #ifndef G_
67 # define G_(gmsgid) gmsgid
68 #endif
70 extern char *get_spaces (const char *);
72 extern const char *open_quote;
73 extern const char *close_quote;
74 extern const char *locale_encoding;
75 extern bool locale_utf8;
77 #endif /* intl.h */