opintl.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /* opintl.h - opcodes specific header for gettext code.
  2. Copyright (C) 1998-2017 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 use of dgetext() and PACKAGE here, rather than gettext().
  20. This is because the code in this directory is used to build a library which
  21. will be linked with code in other directories to form programs. We want to
  22. maintain a seperate translation file for this directory however, rather
  23. than being forced to merge it with that of any program linked to
  24. libopcodes. This is a library, so it cannot depend on the catalog
  25. currently loaded.
  26. In order to do this, we have to make sure that when we extract messages we
  27. use the OPCODES domain rather than the domain of the program that included
  28. the opcodes library, (eg OBJDUMP). Hence we use dgettext (PACKAGE, String)
  29. and define PACKAGE to be 'opcodes'. (See the code in configure). */
  30. # define _(String) dgettext (PACKAGE, String)
  31. # ifdef gettext_noop
  32. # define N_(String) gettext_noop (String)
  33. # else
  34. # define N_(String) (String)
  35. # endif
  36. #else
  37. # define gettext(Msgid) (Msgid)
  38. # define dgettext(Domainname, Msgid) (Msgid)
  39. # define dcgettext(Domainname, Msgid, Category) (Msgid)
  40. # define textdomain(Domainname) while (0) /* nothing */
  41. # define bindtextdomain(Domainname, Dirname) while (0) /* nothing */
  42. # define _(String) (String)
  43. # define N_(String) (String)
  44. #endif