fix a cast warning in perly.c
[p5sagit/p5-mst-13.2.git] / XSUB.h
diff --git a/XSUB.h b/XSUB.h
index 9832b7d..1bf88d5 100644 (file)
--- a/XSUB.h
+++ b/XSUB.h
@@ -107,7 +107,11 @@ is a lexical $_ in scope.
 #  if defined(HASATTRIBUTE_UNUSED) && !defined(__cplusplus)
 #    define XS(name) void name(pTHX_ CV* cv __attribute__unused__)
 #  else
-#    define XS(name) void name(pTHX_ CV* cv)
+#    ifdef __cplusplus
+#      define XS(name) extern "C" void name(pTHX_ CV* cv)
+#    else
+#      define XS(name) void name(pTHX_ CV* cv)
+#    endif
 #  endif
 #endif
 
@@ -148,7 +152,7 @@ is a lexical $_ in scope.
 #define XSINTERFACE_FUNC_SET(cv,f)     \
                CvXSUBANY(cv).any_dxptr = (void (*) (pTHX_ void*))(f)
 
-#define dUNDERBAR I32 padoff_du = find_rundefsvoffset()
+#define dUNDERBAR PADOFFSET padoff_du = find_rundefsvoffset()
 #define UNDERBAR ((padoff_du == NOT_IN_PAD \
            || PAD_COMPNAME_FLAGS_isOUR(padoff_du)) \
        ? DEFSV : PAD_SVl(padoff_du))
@@ -273,7 +277,7 @@ Rethrows a previously caught exception.  See L<perlguts/"Exception Handling">.
 #define XSRETURN_UNDEF STMT_START { XST_mUNDEF(0); XSRETURN(1); } STMT_END
 #define XSRETURN_EMPTY STMT_START {                XSRETURN(0); } STMT_END
 
-#define newXSproto(a,b,c,d)    sv_setpv((SV*)newXS(a,b,c), d)
+#define newXSproto(a,b,c,d)    newXS_flags(a,b,c,d,0)
 
 #ifdef XS_VERSION
 #  define XS_VERSION_BOOTCHECK \
@@ -291,7 +295,7 @@ Rethrows a previously caught exception.  See L<perlguts/"Exception Handling">.
                                    vn = "VERSION"), FALSE);            \
        }                                                               \
        if (_sv) {                                                      \
-           SV *xssv = Perl_newSVpvf(aTHX_ "%s",XS_VERSION);            \
+           SV *xssv = Perl_newSVpv(aTHX_ XS_VERSION, 0);               \
            xssv = new_version(xssv);                                   \
            if ( !sv_derived_from(_sv, "version") )                     \
                _sv = new_version(_sv);                         \
@@ -361,7 +365,6 @@ Rethrows a previously caught exception.  See L<perlguts/"Exception Handling">.
             if (name[7] == 's'){                                \
                 arg = sv_2mortal(arg);                          \
             }                                                   \
-            SvOKp(arg);                                         \
        } } STMT_END                                                     
 
 #if 1          /* for compatibility */
@@ -388,6 +391,7 @@ Rethrows a previously caught exception.  See L<perlguts/"Exception Handling">.
 #  define VTBL_uvar            &PL_vtbl_uvar
 #  define VTBL_defelem         &PL_vtbl_defelem
 #  define VTBL_regexp          &PL_vtbl_regexp
+#  define VTBL_regdata_names   &PL_vtbl_regdata_names
 #  define VTBL_regdata         &PL_vtbl_regdata
 #  define VTBL_regdatum                &PL_vtbl_regdatum
 #  ifdef USE_LOCALE_COLLATE