--- embedaddon/sudo/include/gettext.h 2012/02/21 16:23:02 1.1.1.1 +++ embedaddon/sudo/include/gettext.h 2014/06/15 16:12:54 1.1.1.4 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011 Todd C. Miller + * Copyright (c) 2011-2012 Todd C. Miller * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -21,9 +21,7 @@ * Solaris locale.h includes libintl.h which causes problems when we * redefine the gettext functions. We include it first to avoid this. */ -#if defined(HAVE_LOCALE_H) && defined(__sun__) && defined(__svr4__) -# include -#endif +#include #ifdef HAVE_LIBINTL_H @@ -43,10 +41,20 @@ dngettext(DEFAULT_TEXT_DOMAIN, String, String_Plural, N) # endif +/* + * Older versions of Solaris lack ngettext() so we have to kludge it. + */ +# ifndef HAVE_NGETTEXT +# undef ngettext +# define ngettext(String, String_Plural, N) \ + ((N) == 1 ? gettext(String) : gettext(String_Plural)) +# endif + /* Gettext convenience macros */ # define _(String) gettext(String) # define gettext_noop(String) String # define N_(String) gettext_noop(String) +# define U_(String) warning_gettext(String) #else /* !HAVE_LIBINTL_H */ @@ -56,6 +64,7 @@ */ # define _(String) String # define N_(String) String +# define U_(String) String # define textdomain(Domain) # define bindtextdomain(Package, Directory) # define ngettext(String, String_Plural, N) \