Fix cross compilation (e.g. on Darwin). Following changes to make.tmpl,
[AROS.git] / arch / all-pc / boot / grub2-aros / include / grub / i18n.h
blob468602d926d3e6fd113dfb07856e838bdecfd85b
1 /*
2 * GRUB -- GRand Unified Bootloader
3 * Copyright (C) 2009,2010 Free Software Foundation, Inc.
5 * GRUB is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
10 * GRUB 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
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
19 #ifndef GRUB_I18N_H
20 #define GRUB_I18N_H 1
22 #include <config.h>
23 #include <grub/symbol.h>
25 /* NLS can be disabled through the configure --disable-nls option. */
26 #if (defined(ENABLE_NLS) && ENABLE_NLS) || !defined (GRUB_UTIL)
28 extern const char *(*EXPORT_VAR(grub_gettext)) (const char *s) __attribute__ ((format_arg (1)));
30 # ifdef GRUB_UTIL
32 # include <locale.h>
33 # include <libintl.h>
35 # endif /* GRUB_UTIL */
37 #else /* ! (defined(ENABLE_NLS) && ENABLE_NLS) */
39 /* Disabled NLS.
40 The casts to 'const char *' serve the purpose of producing warnings
41 for invalid uses of the value returned from these functions.
42 On pre-ANSI systems without 'const', the config.h file is supposed to
43 contain "#define const". */
44 static inline const char * __attribute__ ((always_inline,format_arg (1)))
45 gettext (const char *str)
47 return str;
50 #endif /* (defined(ENABLE_NLS) && ENABLE_NLS) */
52 #ifdef GRUB_UTIL
53 static inline const char * __attribute__ ((always_inline,format_arg (1)))
54 _ (const char *str)
56 return gettext(str);
58 #else
59 static inline const char * __attribute__ ((always_inline,format_arg (1)))
60 _ (const char *str)
62 return grub_gettext(str);
64 #endif /* GRUB_UTIL */
66 #define N_(str) str
68 #endif /* GRUB_I18N_H */