summaryrefslogtreecommitdiff
path: root/win32/win32.h
diff options
context:
space:
mode:
authorDaniel Dragan <bulk88@hotmail.com>2012-07-16 16:02:45 -0400
committerJan Dubois <jand@activestate.com>2012-07-18 15:30:30 -0700
commit12a2785c7e86f586a05cad9ff90ce673c68c3115 (patch)
treeb1debe71307e649ac7b751f5e1feab5456896f7c /win32/win32.h
parent6db9054f2b5640f8df429d7daec73a0d5af01a8a (diff)
downloadperl-12a2785c7e86f586a05cad9ff90ce673c68c3115.tar.gz
Adding support for Visual C's __declspec(noreturn) function declarations to perl
This will reduce the machine code size on Visual C Perl, by removing C stack clean up opcodes and possible jmp opcodes after croak() and similar functions. Perl's existing __attribute__noreturn__ macro (and therefore GCC's __attribute__((noreturn)) ) is fundamentally incompatible with MS's implementation for noreturn functions. win32.h already has _MSC_VER aware code blocks, so adding more isn't a problem.
Diffstat (limited to 'win32/win32.h')
-rw-r--r--win32/win32.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/win32/win32.h b/win32/win32.h
index e906266a4a..2c821eb24e 100644
--- a/win32/win32.h
+++ b/win32/win32.h
@@ -66,8 +66,14 @@
#if !defined(PERLDLL) && !defined(PERL_EXT_RE_BUILD)
# ifdef __cplusplus
# define PERL_CALLCONV extern "C" __declspec(dllimport)
+# ifdef _MSC_VER
+# define PERL_CALLCONV_NO_RET extern "C" __declspec(dllimport, noreturn)
+# endif
# else
# define PERL_CALLCONV __declspec(dllimport)
+# ifdef _MSC_VER
+# define PERL_CALLCONV_NO_RET __declspec(dllimport, noreturn)
+# endif
# endif
#endif