opintl.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /* opintl.h - opcodes specific header for gettext code.
  2. Copyright (C) 1998-2022 Free Software Foundation, Inc.
  3. Written by Tom Tromey <tromey@cygnus.com>
  4. This file is part of the GNU opcodes library.
  5. This library 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, or (at your option)
  8. any later version.
  9. It is distributed in the hope that it will be useful, but WITHOUT
  10. ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  11. or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
  12. License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this file; see the file COPYING. If not, write to the
  15. Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston,
  16. MA 02110-1301, USA. */
  17. #ifdef ENABLE_NLS
  18. # include <libintl.h>
  19. /* Note the redefinition of gettext and ngettext here to use PACKAGE.
  20. This is because the code in this directory is used to build a
  21. library which will be linked with code in other directories to form
  22. programs. We want to maintain a separate translation file for this
  23. directory however, rather than being forced to merge it with that
  24. of any program linked to libopcodes. This is a library, so it
  25. cannot depend on the catalog currently loaded.
  26. In order to do this, we have to make sure that when we extract
  27. messages we use the OPCODES domain rather than the domain of the
  28. program that included the opcodes library, (eg OBJDUMP). Hence we
  29. use dgettext (PACKAGE, String) and define PACKAGE to be 'opcodes'.
  30. (See the code in configure). */
  31. # undef gettext
  32. # define gettext(Msgid) dgettext (PACKAGE, Msgid)
  33. # undef ngettext
  34. # define ngettext(Msgid1, Msgid2, n) dngettext (PACKAGE, Msgid1, Msgid2, n)
  35. # define _(String) gettext (String)
  36. # ifdef gettext_noop
  37. # define N_(String) gettext_noop (String)
  38. # else
  39. # define N_(String) (String)
  40. # endif
  41. #else
  42. # define gettext(Msgid) (Msgid)
  43. # define dgettext(Domainname, Msgid) (Msgid)
  44. # define dcgettext(Domainname, Msgid, Category) (Msgid)
  45. # define ngettext(Msgid1, Msgid2, n) \
  46. (n == 1 ? Msgid1 : Msgid2)
  47. # define dngettext(Domainname, Msgid1, Msgid2, n) \
  48. (n == 1 ? Msgid1 : Msgid2)
  49. # define dcngettext(Domainname, Msgid1, Msgid2, n, Category) \
  50. (n == 1 ? Msgid1 : Msgid2)
  51. # define textdomain(Domainname) do {} while (0)
  52. # define bindtextdomain(Domainname, Dirname) do {} while (0)
  53. # define _(String) (String)
  54. # define N_(String) (String)
  55. #endif