intl.h 1.8 KB

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