diff options
Diffstat (limited to 'lib/putenv.c')
-rw-r--r-- | lib/putenv.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/putenv.c b/lib/putenv.c index ba1cc07dd..665efffa0 100644 --- a/lib/putenv.c +++ b/lib/putenv.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1994, 1997-1998, 2000, 2003-2017 Free Software +/* Copyright (C) 1991, 1994, 1997-1998, 2000, 2003-2021 Free Software Foundation, Inc. NOTE: The canonical source of this file is maintained with the GNU C @@ -15,7 +15,7 @@ GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. */ + along with this program. If not, see <https://www.gnu.org/licenses/>. */ #include <config.h> @@ -34,7 +34,7 @@ #include <string.h> #include <unistd.h> -#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +#if defined _WIN32 && ! defined __CYGWIN__ # define WIN32_LEAN_AND_MEAN # include <windows.h> #endif @@ -58,6 +58,12 @@ __libc_lock_define_initialized (static, envlock) # define UNLOCK #endif +#if defined _WIN32 && ! defined __CYGWIN__ +/* Don't assume that UNICODE is not defined. */ +# undef SetEnvironmentVariable +# define SetEnvironmentVariable SetEnvironmentVariableA +#endif + static int _unsetenv (const char *name) { @@ -153,7 +159,7 @@ putenv (char *string) *ep = string; break; } -# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +# if defined _WIN32 && ! defined __CYGWIN__ if (putenv_result == 0) { /* _putenv propagated "NAME= " into the subprocess environment; |