Blame src/gettext.h

Packit fc043f
/* Convenience header for conditional use of GNU <libintl.h>.
Packit fc043f
   Copyright (C) 1995-1998, 2000-2002 Free Software Foundation, Inc.
Packit fc043f
Packit fc043f
   This program is free software; you can redistribute it and/or modify it
Packit fc043f
   under the terms of the GNU Library General Public License as published
Packit fc043f
   by the Free Software Foundation; either version 2, or (at your option)
Packit fc043f
   any later version.
Packit fc043f
Packit fc043f
   This program is distributed in the hope that it will be useful,
Packit fc043f
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit fc043f
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit fc043f
   Library General Public License for more details.
Packit fc043f
Packit fc043f
   You should have received a copy of the GNU Library General Public
Packit fc043f
   License along with this program; if not, write to the Free Software
Packit fc043f
   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
Packit fc043f
   USA.  */
Packit fc043f
Packit fc043f
#ifndef _LIBGETTEXT_H
Packit fc043f
#define _LIBGETTEXT_H 1
Packit fc043f
Packit fc043f
/* NLS can be disabled through the configure --disable-nls option.  */
Packit fc043f
#if ENABLE_NLS
Packit fc043f
Packit fc043f
#if HAVE_W32_SYSTEM
Packit fc043f
  /* We have a gettext implementation in gpg-error.h which get
Packit fc043f
     included anyway.  */
Packit fc043f
#else /*!HAVE_W32_SYSTEM*/
Packit fc043f
  /* Get declarations of GNU message catalog functions.  */
Packit fc043f
# include <libintl.h>
Packit fc043f
#endif /*!HAVE_W32_SYSTEM*/
Packit fc043f
Packit fc043f
#else /*!ENABLE_NLS*/
Packit fc043f
Packit fc043f
/* Solaris /usr/include/locale.h includes /usr/include/libintl.h, which
Packit fc043f
   chokes if dcgettext is defined as a macro.  So include it now, to make
Packit fc043f
   later inclusions of <locale.h> a NOP.  We don't include <libintl.h>
Packit fc043f
   as well because people using "gettext.h" will not include <libintl.h>,
Packit fc043f
   and also including <libintl.h> would fail on SunOS 4, whereas <locale.h>
Packit fc043f
   is OK.  */
Packit fc043f
#if defined(__sun)
Packit fc043f
# include <locale.h>
Packit fc043f
#endif
Packit fc043f
Packit fc043f
/* Disabled NLS.
Packit fc043f
   The casts to 'const char *' serve the purpose of producing warnings
Packit fc043f
   for invalid uses of the value returned from these functions.
Packit fc043f
   On pre-ANSI systems without 'const', the config.h file is supposed to
Packit fc043f
   contain "#define const".  */
Packit fc043f
# define gettext(Msgid) ((const char *) (Msgid))
Packit fc043f
# define dgettext(Domainname, Msgid) ((const char *) (Msgid))
Packit fc043f
# define dcgettext(Domainname, Msgid, Category) ((const char *) (Msgid))
Packit fc043f
# define ngettext(Msgid1, Msgid2, N) \
Packit fc043f
    ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2))
Packit fc043f
# define dngettext(Domainname, Msgid1, Msgid2, N) \
Packit fc043f
    ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2))
Packit fc043f
# define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \
Packit fc043f
    ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2))
Packit fc043f
# define textdomain(Domainname) ((const char *) (Domainname))
Packit fc043f
# define bindtextdomain(Domainname, Dirname) ((const char *) (Dirname))
Packit fc043f
# define bind_textdomain_codeset(Domainname, Codeset) ((const char *) (Codeset))
Packit fc043f
Packit fc043f
#endif /*!ENABLE_NLS*/
Packit fc043f
Packit fc043f
/* A pseudo function call that serves as a marker for the automated
Packit fc043f
   extraction of messages, but does not call gettext().  The run-time
Packit fc043f
   translation is done at a different place in the code.
Packit fc043f
   The argument, String, should be a literal string.  Concatenated strings
Packit fc043f
   and other string expressions won't work.
Packit fc043f
   The macro's expansion is not parenthesized, so that it is suitable as
Packit fc043f
   initializer for static 'char[]' or 'const char[]' variables.  */
Packit fc043f
#define gettext_noop(String) String
Packit fc043f
Packit fc043f
Packit fc043f
Packit fc043f
#endif /* _LIBGETTEXT_H */