From: Bruno Haible Date: Sat, 27 Apr 2019 02:58:24 +0000 (+0200) Subject: Fix a gcc warning on mingw. X-Git-Tag: v0.20~36 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4c23cf73b31d518a3424fa1571ecd384dbe4485a;p=thirdparty%2Fgettext.git Fix a gcc warning on mingw. * gettext-tools/src/msginit.c (get_user_pwd): Don't define if HAVE_PWD_H is not set. (get_user_fullname): Don't call get_user_pwd if HAVE_PWD_H is not set. --- diff --git a/gettext-tools/src/msginit.c b/gettext-tools/src/msginit.c index f17d01e84..0098bc74a 100644 --- a/gettext-tools/src/msginit.c +++ b/gettext-tools/src/msginit.c @@ -1020,11 +1020,12 @@ po_revision_date (const char *header) } +#if HAVE_PWD_H /* Only Unix, not native Windows. */ + /* Returns the struct passwd entry for the current user. */ static struct passwd * get_user_pwd () { -#if HAVE_PWD_H /* Only Unix, not native Woe32. */ const char *username; struct passwd *userpasswd; @@ -1059,20 +1060,21 @@ get_user_pwd () return userpasswd; if (errno != 0) error (EXIT_FAILURE, errno, "getpwuid(%ju)", (uintmax_t) getuid ()); -#endif return NULL; } +#endif + /* Return the user's full name. */ static const char * get_user_fullname () { +#if HAVE_PWD_H struct passwd *pwd; pwd = get_user_pwd (); -#if HAVE_PWD_H if (pwd != NULL) { const char *fullname;