summaryrefslogtreecommitdiff
path: root/inline.h
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2022-12-12 19:51:40 -0700
committerKarl Williamson <khw@cpan.org>2023-01-12 17:42:00 -0700
commit65be4a0ded9e67be17d2c559c1c0dc8d3d746ed6 (patch)
tree838d3a8923554b997c8b033d79c64170a11007f1 /inline.h
parent2dc676e9ce23feb0ae948ea62f7e4301931d2188 (diff)
downloadperl-65be4a0ded9e67be17d2c559c1c0dc8d3d746ed6.tar.gz
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.
Diffstat (limited to 'inline.h')
-rw-r--r--inline.h19
1 files changed, 19 insertions, 0 deletions
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)