7474# define THR_newSVsv_cow (sv ) newSVsv_flags((sv), SV_GMAGIC|SV_NOSTEAL)
7575#endif
7676
77+ /* Added in 5.17.6 in commit 284167a54e2 10/9/2012 5:19:37 AM
78+ Add C define to remove taint support from perl */
79+ #ifndef TAINT_get
80+ # define TAINT_get (PL_tainted)
81+ #endif
82+
83+ #ifndef LIKELY
84+ # define LIKELY (x ) (x)
85+ #endif
86+
87+ #ifndef UNLIKELY
88+ # define UNLIKELY (x ) (x)
89+ #endif
90+
7791/* PL_op->op_private & OPpENTERSUB_HASTARG feature was added in
7892
7993d30110745a - Ilya Zakharevich -8/26/1999 11:33:01 PM - 5.5.61
@@ -1228,10 +1242,12 @@ static void
12281242S_croak_xs_unimplemented (CV * const cv )
12291243{
12301244 dTHX ;
1245+ /* added in 5.21.4 commit c5569a55d2 - 8/28/2014 6:56:30 PM - cv_name */
1246+ #ifdef cv_name
12311247 SV * sv = cv_name (cv , NULL , 0 );
12321248 Perl_croak_nocontext (
12331249 "%s::%s(): unimplemented in this platform" + (sizeof ("%s::" )- 1 ), SvPVX (sv ));
1234- #if 0 /* former implementation, retired because of machine code bloat */
1250+ #else
12351251 char buf [sizeof ("CODE(0x%" UVxf ")" ) + (sizeof (UV )* 8 )];
12361252 const char * pv1 ;
12371253 const GV * const gv = CvGV (cv );
@@ -1365,26 +1381,26 @@ BOOT:
13651381# endif
13661382#endif
13671383#if defined(HAS_GETITIMER ) && defined(HAS_SETITIMER )
1368- # define GETITIMER_SUBSTR "Time::HiRes::getitimer"+13
1369- # define SETITIMER_SUBSTR "Time::HiRes::setitimer"+13
1384+ # define GETITIMER_SUBSTR NUM2PTR(const char *, "Time::HiRes::getitimer") +13
1385+ # define SETITIMER_SUBSTR NUM2PTR(const char *, "Time::HiRes::setitimer") +13
13701386#else
1371- # define GETITIMER_SUBSTR "d_getitimer"+2
1372- # define SETITIMER_SUBSTR "d_setitimer"+2
1387+ # define GETITIMER_SUBSTR NUM2PTR(const char *, "d_getitimer") +2
1388+ # define SETITIMER_SUBSTR NUM2PTR(const char *, "d_setitimer") +2
13731389#endif
1374- #define INIT1 INIT2(sym_usleep, "Time::HiRes::usleep"+13, sizeof("usleep")-1, NULL, 0) \
1375- INIT2(sym_sleep, "Time::HiRes::sleep"+13, sizeof("sleep")-1, NULL, 0) \
1376- INIT2(sym_ualarm, "Time::HiRes::ualarm"+13, sizeof("ualarm")-1, NULL, 0) \
1377- INIT2(sym_alarm, "Time::HiRes::alarm"+13, sizeof("alarm")-1, NULL, 0) \
1378- INIT2(sym_gettimeofday, "Time::HiRes::gettimeofday"+13, sizeof("gettimeofday")-1, NULL, 0) \
1379- INIT2(sym_time, "Time::HiRes::time"+13, sizeof("time")-1, NULL, 0) \
1390+ #define INIT1 INIT2(sym_usleep, NUM2PTR(const char *, "Time::HiRes::usleep") +13, sizeof("usleep")-1, NULL, 0) \
1391+ INIT2(sym_sleep, NUM2PTR(const char *, "Time::HiRes::sleep") +13, sizeof("sleep")-1, NULL, 0) \
1392+ INIT2(sym_ualarm, NUM2PTR(const char *, "Time::HiRes::ualarm") +13, sizeof("ualarm")-1, NULL, 0) \
1393+ INIT2(sym_alarm, NUM2PTR(const char *, "Time::HiRes::alarm") +13, sizeof("alarm")-1, NULL, 0) \
1394+ INIT2(sym_gettimeofday, NUM2PTR(const char *, "Time::HiRes::gettimeofday") +13, sizeof("gettimeofday")-1, NULL, 0) \
1395+ INIT2(sym_time, NUM2PTR(const char *, "Time::HiRes::time") +13, sizeof("time")-1, NULL, 0) \
13801396INIT2(sym_tv_interval, "tv_interval", sizeof("tv_interval")-1, NULL, 0) \
13811397INIT2(sym_getitimer, GETITIMER_SUBSTR, sizeof("getitimer")-1, NULL, 0) \
13821398INIT2(sym_setitimer, SETITIMER_SUBSTR, sizeof("setitimer")-1, NULL, 0) \
1383- INIT2(sym_nanosleep, "Time::HiRes::nanosleep"+13, sizeof("nanosleep")-1, NULL, 0) \
1384- INIT2(sym_clock_gettime, "Time::HiRes::clock_gettime"+13, sizeof("clock_gettime")-1, NULL, 0) \
1385- INIT2(sym_clock_getres, "Time::HiRes::clock_getres"+13, sizeof("clock_getres")-1, NULL, 0) \
1386- INIT2(sym_clock, "Time::HiRes::clock"+13, sizeof("clock")-1, NULL, 0) \
1387- INIT2(sym_clock_nanosleep, "Time::HiRes::clock_nanosleep"+13, sizeof("clock_nanosleep")-1, NULL, 0) \
1399+ INIT2(sym_nanosleep, NUM2PTR(const char *, "Time::HiRes::nanosleep") +13, sizeof("nanosleep")-1, NULL, 0) \
1400+ INIT2(sym_clock_gettime, NUM2PTR(const char *, "Time::HiRes::clock_gettime") +13, sizeof("clock_gettime")-1, NULL, 0) \
1401+ INIT2(sym_clock_getres, NUM2PTR(const char *, "Time::HiRes::clock_getres") +13, sizeof("clock_getres")-1, NULL, 0) \
1402+ INIT2(sym_clock, NUM2PTR(const char *, "Time::HiRes::clock") +13, sizeof("clock")-1, NULL, 0) \
1403+ INIT2(sym_clock_nanosleep, NUM2PTR(const char *, "Time::HiRes::clock_nanosleep") +13, sizeof("clock_nanosleep")-1, NULL, 0) \
13881404INIT2(sym_CLOCKS_PER_SEC, "CLOCKS_PER_SEC", sizeof("CLOCKS_PER_SEC")-1, NULL, 0) \
13891405INIT2(sym_CLOCK_BOOTTIME, "CLOCK_BOOTTIME", sizeof("CLOCK_BOOTTIME")-1, NULL, 0) \
13901406INIT2(sym_CLOCK_HIGHRES, "CLOCK_HIGHRES", sizeof("CLOCK_HIGHRES")-1, NULL, 0) \
@@ -1415,23 +1431,23 @@ INIT2(sym_ITIMER_REAL, "ITIMER_REAL", sizeof("ITIMER_REAL")-1, NULL, 0) \
14151431INIT2(sym_ITIMER_REALPROF, "ITIMER_REALPROF", sizeof("ITIMER_REALPROF")-1, NULL, 0) \
14161432INIT2(sym_ITIMER_VIRTUAL, "ITIMER_VIRTUAL", sizeof("ITIMER_VIRTUAL")-1, NULL, 0) \
14171433INIT2(sym_TIMER_ABSTIME, "TIMER_ABSTIME", sizeof("TIMER_ABSTIME")-1, NULL, 0) \
1418- INIT2(sym_d_usleep, "d_usleep", sizeof("d_usleep")-1, "Time::HiRes::usleep"+13, 1) \
1419- INIT2(sym_d_ualarm, "d_ualarm", sizeof("d_ualarm")-1, "Time::HiRes::ualarm"+13, 1) \
1420- INIT2(sym_d_gettimeofday, "d_gettimeofday", sizeof("d_gettimeofday")-1, "Time::HiRes::gettimeofday"+13, 1) \
1434+ INIT2(sym_d_usleep, "d_usleep", sizeof("d_usleep")-1, NUM2PTR(const char *, "Time::HiRes::usleep") +13, 1) \
1435+ INIT2(sym_d_ualarm, "d_ualarm", sizeof("d_ualarm")-1, NUM2PTR(const char *, "Time::HiRes::ualarm") +13, 1) \
1436+ INIT2(sym_d_gettimeofday, "d_gettimeofday", sizeof("d_gettimeofday")-1, NUM2PTR(const char *, "Time::HiRes::gettimeofday") +13, 1) \
14211437INIT2(sym_d_getitimer, "d_getitimer", sizeof("d_getitimer")-1, GETITIMER_SUBSTR, 1) \
14221438INIT2(sym_d_setitimer, "d_setitimer", sizeof("d_setitimer")-1, SETITIMER_SUBSTR, 1) \
1423- INIT2(sym_d_nanosleep, "d_nanosleep", sizeof("d_nanosleep")-1, "Time::HiRes::nanosleep"+13, 1) \
1424- INIT2(sym_d_clock_gettime, "d_clock_gettime", sizeof("d_clock_gettime")-1, "Time::HiRes::clock_gettime"+13, 1) \
1425- INIT2(sym_d_clock_getres, "d_clock_getres", sizeof("d_clock_getres")-1, "Time::HiRes::clock_getres"+13, 1) \
1426- INIT2(sym_d_clock, "d_clock", sizeof("d_clock")-1, "Time::HiRes::clock"+13, 1) \
1427- INIT2(sym_d_clock_nanosleep, "d_clock_nanosleep", sizeof("d_clock_nanosleep")-1, "Time::HiRes::clock_nanosleep"+13, 1) \
1439+ INIT2(sym_d_nanosleep, "d_nanosleep", sizeof("d_nanosleep")-1, NUM2PTR(const char *, "Time::HiRes::nanosleep") +13, 1) \
1440+ INIT2(sym_d_clock_gettime, "d_clock_gettime", sizeof("d_clock_gettime")-1, NUM2PTR(const char *, "Time::HiRes::clock_gettime") +13, 1) \
1441+ INIT2(sym_d_clock_getres, "d_clock_getres", sizeof("d_clock_getres")-1, NUM2PTR(const char *, "Time::HiRes::clock_getres") +13, 1) \
1442+ INIT2(sym_d_clock, "d_clock", sizeof("d_clock")-1, NUM2PTR(const char *, "Time::HiRes::clock") +13, 1) \
1443+ INIT2(sym_d_clock_nanosleep, "d_clock_nanosleep", sizeof("d_clock_nanosleep")-1, NUM2PTR(const char *, "Time::HiRes::clock_nanosleep") +13, 1) \
14281444INIT2(sym_d_hires_stat, "d_hires_stat", sizeof("d_hires_stat")-1, NULL, 0) \
14291445INIT2(sym_d_futimens, "d_futimens", sizeof("d_futimens")-1, NULL, 0) \
14301446INIT2(sym_d_utimensat, "d_utimensat", sizeof("d_utimensat")-1, NULL, 0) \
14311447INIT2(sym_d_hires_utime, "d_hires_utime", sizeof("d_hires_utime")-1, NULL, 0) \
1432- INIT2(sym_stat, "Time::HiRes::stat"+13, sizeof("stat")-1, NULL, 0) \
1433- INIT2(sym_lstat, "Time::HiRes::lstat"+13, sizeof("lstat")-1, NULL, 0) \
1434- INIT2(sym_utime, "Time::HiRes::utime"+13, sizeof("utime")-1, NULL, 0)
1448+ INIT2(sym_stat, NUM2PTR(const char *, "Time::HiRes::stat") +13, sizeof("stat")-1, NULL, 0) \
1449+ INIT2(sym_lstat, NUM2PTR(const char *, "Time::HiRes::lstat") +13, sizeof("lstat")-1, NULL, 0) \
1450+ INIT2(sym_utime, NUM2PTR(const char *, "Time::HiRes::utime") +13, sizeof("utime")-1, NULL, 0)
14351451/* A test inside ../dist/XSLoader/t/XSLoader.t, doesn't allow us to
14361452 pass any args from our .pm to .xs. So this idea is rejected:
14371453 XSLoader::load( 'Time::HiRes', $XS_VERSION, \@EXPORT_OK );
@@ -1444,7 +1460,7 @@ INIT2(sym_utime, "Time::HiRes::utime"+13, sizeof("utime")-1, NULL, 0)
14441460 INIT1
14451461 };
14461462#undef INIT2
1447- #define INIT2 (_s , _str , _l , _d , _db ) ((_db) ? ((I8)-((I8)( _l))) : ( _l)),
1463+ #define INIT2 (_s , _str , _l , _d , _db ) ((_db) ? NUM2PTR(I8,-NUM2PTR(I8, _l)) : NUM2PTR(I8, _l)),
14481464 static const I8 expoklen [] = {
14491465 INIT1
14501466 };
@@ -1974,10 +1990,10 @@ PROTOTYPE: $$@
19741990 tot ++ ;
19751991 }
19761992 } else {
1977- croak ("%s unimplemented in this platform" , "d_futimens" + 2 );
1993+ croak ("%s unimplemented in this platform" , NUM2PTR ( const char * , "d_futimens" ) + 2 );
19781994 }
19791995# else /* HAS_FUTIMENS */
1980- croak ("%s unimplemented in this platform" , "d_futimens" + 2 );
1996+ croak ("%s unimplemented in this platform" , NUM2PTR ( const char * , "d_futimens" ) + 2 );
19811997# endif /* HAS_FUTIMENS */
19821998 }
19831999 }
@@ -1992,10 +2008,10 @@ PROTOTYPE: $$@
19922008 tot ++ ;
19932009 }
19942010 } else {
1995- croak ("%s unimplemented in this platform" , "d_utimensat" + 2 );
2011+ croak ("%s unimplemented in this platform" , NUM2PTR ( const char * , "d_utimensat" ) + 2 );
19962012 }
19972013# else /* HAS_UTIMENSAT */
1998- croak ("%s unimplemented in this platform" , "d_utimensat" + 2 );
2014+ croak ("%s unimplemented in this platform" , NUM2PTR ( const char * , "d_utimensat" ) + 2 );
19992015# endif /* HAS_UTIMENSAT */
20002016 }
20012017 } /* while items */
0 commit comments