summaryrefslogtreecommitdiff
path: root/proto.h
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2023-02-02 18:11:26 -0700
committerKarl Williamson <khw@cpan.org>2023-03-01 17:00:52 -0700
commit32346b7cdde5bcf8a0c8c9ee89ef541d8fe9a7b7 (patch)
treec1c1d1654e828dff1e17af76834bb73383a0f114 /proto.h
parent4a7bea40c45452cd472c087fe36c369a1b5ffc36 (diff)
downloadperl-32346b7cdde5bcf8a0c8c9ee89ef541d8fe9a7b7.tar.gz
Inline get_context() for non-Win32
This trivial function should get optimized out. But I couldn't get it to work for Windows, because the two likely hdr files don't have PL_thr_key defined in them. I suppose a new hdr file could be created that gets included later. But I didn't think it was worth it.
Diffstat (limited to 'proto.h')
-rw-r--r--proto.h17
1 files changed, 12 insertions, 5 deletions
diff --git a/proto.h b/proto.h
index 71d46c15a7..e4698aa469 100644
--- a/proto.h
+++ b/proto.h
@@ -1198,11 +1198,6 @@ Perl_get_av(pTHX_ const char *name, I32 flags);
#define PERL_ARGS_ASSERT_GET_AV \
assert(name)
-PERL_CALLCONV void *
-Perl_get_context(void)
- __attribute__warn_unused_result__;
-#define PERL_ARGS_ASSERT_GET_CONTEXT
-
PERL_CALLCONV CV *
Perl_get_cv(pTHX_ const char *name, I32 flags);
#define PERL_ARGS_ASSERT_GET_CV \
@@ -10095,6 +10090,13 @@ S_PerlEnv_putenv(pTHX_ char *str);
# endif /* !defined(PERL_IMPLICIT_SYS) */
# endif /* defined(USE_ITHREADS) */
+# if !defined(WIN32)
+PERL_STATIC_INLINE void *
+Perl_get_context(void)
+ __attribute__warn_unused_result__;
+# define PERL_ARGS_ASSERT_GET_CONTEXT
+
+# endif /* !defined(WIN32) */
#endif /* !defined(PERL_NO_INLINE_FUNCTIONS) */
#if defined(PERL_USE_3ARG_SIGHANDLER)
PERL_CALLCONV Signal_t
@@ -10498,6 +10500,11 @@ Perl_do_spawn_nowait(pTHX_ char *cmd);
#endif /* defined(VMS) || defined(WIN32) */
#if defined(WIN32)
+PERL_CALLCONV void *
+Perl_get_context(void)
+ __attribute__warn_unused_result__;
+# define PERL_ARGS_ASSERT_GET_CONTEXT
+
PERL_CALLCONV bool
Perl_get_win32_message_utf8ness(pTHX_ const char *string)
__attribute__visibility__("hidden");