1 #define PERL_NO_GET_CONTEXT 1
2 #include "EXTERN.h"
3 #include "perl.h"
4 #include "XSUB.h"
5 
6 #define PERL_VERSION_DECIMAL(r,v,s) (r*1000000 + v*1000 + s)
7 #define PERL_DECIMAL_VERSION \
8 	PERL_VERSION_DECIMAL(PERL_REVISION,PERL_VERSION,PERL_SUBVERSION)
9 #define PERL_VERSION_GE(r,v,s) \
10 	(PERL_DECIMAL_VERSION >= PERL_VERSION_DECIMAL(r,v,s))
11 
12 #if defined(WIN32) && PERL_VERSION_GE(5,13,6)
13 # define MY_BASE_CALLCONV EXTERN_C
14 #else /* !(WIN32 && >= 5.13.6) */
15 # define MY_BASE_CALLCONV PERL_CALLCONV
16 #endif /* !(WIN32 && >= 5.13.6) */
17 
18 #define MY_EXPORT_CALLCONV MY_BASE_CALLCONV
19 
dynalow_foo(void)20 MY_EXPORT_CALLCONV int dynalow_foo(void)
21 {
22 	return 42;
23 }
24 
dynalow_bar(void)25 MY_EXPORT_CALLCONV int dynalow_bar(void)
26 {
27 	return 69;
28 }
29 
30 /* this is necessary for building on some platforms */
boot_t__dyna_low(void)31 MY_EXPORT_CALLCONV int boot_t__dyna_low(void)
32 {
33 	return 666;
34 }
35