summaryrefslogtreecommitdiff
path: root/win32/win32.c
diff options
context:
space:
mode:
authorDaniel Dragan <bulk88@hotmail.com>2012-10-27 22:25:47 -0400
committerJan Dubois <jand@activestate.com>2012-11-08 16:54:55 -0800
commit073dd0357a846739ff3ae9a14379de2302d5e877 (patch)
treee98d00b9a5881f5381d9815828990a60737fe091 /win32/win32.c
parente566981e5a5b2c2716eea4363106c4ed7620e5bb (diff)
downloadperl-073dd0357a846739ff3ae9a14379de2302d5e877.tar.gz
"func not implemented" croaks optimizations in /win32/*
This commit removes a number of "* not implemented" strings from the image. A win32_croak_not_implemented wrapper is created to reduce machine code by not putting the format string on the C stack many times. embed.fnc was used to declare win32_croak_not_implemented for proper cross compiler support of noreturn (noreturn on GCC and VC ok). Tailcalling and noreturn optimizations of the C compiler are heavily used in this commit.
Diffstat (limited to 'win32/win32.c')
-rw-r--r--win32/win32.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/win32/win32.c b/win32/win32.c
index 5a932ca7f6..1686594a3c 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -1676,6 +1676,14 @@ out_of_memory(void)
exit(1);
}
+void
+win32_croak_not_implemented(const char * fname)
+{
+ PERL_ARGS_ASSERT_WIN32_CROAK_NOT_IMPLEMENTED;
+
+ Perl_croak_nocontext("%s not implemented!\n", fname);
+}
+
/* Converts a wide character (UTF-16) string to the Windows ANSI code page,
* potentially using the system's default replacement character for any
* unrepresentable characters. The caller must free() the returned string. */
@@ -2901,8 +2909,7 @@ win32_pipe(int *pfd, unsigned int size, int mode)
DllExport PerlIO*
win32_popenlist(const char *mode, IV narg, SV **args)
{
- dTHX;
- Perl_croak(aTHX_ "List form of pipe open not implemented");
+ Perl_croak_nocontext("List form of pipe open not implemented");
return NULL;
}