From 65be4a0ded9e67be17d2c559c1c0dc8d3d746ed6 Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Mon, 12 Dec 2022 19:51:40 -0700 Subject: Fix PerlEnv_putenv threaded compilation on Windows A second compilation of a workspace would fail. The first one would succeed because miniperl was being used, which isn't threaded. --- inline.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'inline.h') diff --git a/inline.h b/inline.h index 38de751bd6..06a773d2c3 100644 --- a/inline.h +++ b/inline.h @@ -281,6 +281,25 @@ S_strip_spaces(pTHX_ const char * orig, STRLEN * const len) } #endif +/* ------------------------------- iperlsys.h ------------------------------- */ +#if ! defined(PERL_IMPLICIT_SYS) && defined(USE_ITHREADS) + +/* Otherwise this function is implemented as macros in iperlsys.h */ + +PERL_STATIC_INLINE bool +Perl_PerlEnv_putenv(pTHX_ char * str) +{ + PERL_ARGS_ASSERT_PERLENV_PUTENV; + + ENV_LOCK; + bool retval = putenv(str); + ENV_UNLOCK; + + return retval; +} + +#endif + /* ------------------------------- mg.h ------------------------------- */ #if defined(PERL_CORE) || defined(PERL_EXT) -- cgit v1.2.1