Enable Menu > Quit to work again after startup on macOS
[ardour.git] / gtk2_ardour / gettext.h
1 /* Convenience header for conditional use of GNU <libintl.h>.
2  *
3  * Copyright (C) 1995-1998, 2000-2002 Free Software Foundation, Inc.
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18  */
19
20 #ifndef _LIBGETTEXT_H
21 #define _LIBGETTEXT_H 1
22
23 /* NLS can be disabled through the configure --disable-nls option.  */
24 #if ENABLE_NLS
25
26 /* Get declarations of GNU message catalog functions.  */
27 # include <libintl.h>
28
29 #else
30
31 /* Solaris /usr/include/locale.h includes /usr/include/libintl.h, which
32    chokes if dcgettext is defined as a macro.  So include it now, to make
33    later inclusions of <locale.h> a NOP.  We don't include <libintl.h>
34    as well because people using "gettext.h" will not include <libintl.h>,
35    and also including <libintl.h> would fail on SunOS 4, whereas <locale.h>
36    is OK.  */
37 #if defined(__sun)
38 # include <locale.h>
39 #endif
40
41 /* Disabled NLS.
42    The casts to 'const char *' serve the purpose of producing warnings
43    for invalid uses of the value returned from these functions.
44    On pre-ANSI systems without 'const', the config.h file is supposed to
45    contain "#define const".  */
46
47 /* other headers may have included libintl.h */
48
49 # undef gettext
50 # undef dgettext
51 # undef dcgettext
52 # undef ngettext
53 # undef dngettext
54 # undef dcngettext
55 # undef textdomain
56 # undef bindtextdomain
57 # undef bind_textdomain_codeset
58
59 # define gettext(Msgid) ((const char *) (Msgid))
60 # define dgettext(Domainname, Msgid) ((const char *) (Msgid))
61 # define dcgettext(Domainname, Msgid, Category) ((const char *) (Msgid))
62 # define ngettext(Msgid1, Msgid2, N) \
63     ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2))
64 # define dngettext(Domainname, Msgid1, Msgid2, N) \
65     ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2))
66 # define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \
67     ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2))
68 # define textdomain(Domainname) ((const char *) (Domainname))
69 # define bindtextdomain(Domainname, Dirname) ((const char *) (Dirname))
70 # define bind_textdomain_codeset(Domainname, Codeset) ((const char *) (Codeset))
71
72 #endif
73
74 /* A pseudo function call that serves as a marker for the automated
75    extraction of messages, but does not call gettext().  The run-time
76    translation is done at a different place in the code.
77    The argument, String, should be a literal string.  Concatenated strings
78    and other string expressions won't work.
79    The macro's expansion is not parenthesized, so that it is suitable as
80    initializer for static 'char[]' or 'const char[]' variables.  */
81 #define gettext_noop(String) String
82
83 #endif /* _LIBGETTEXT_H */