This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fix debugging output for REx
[perl5.git] / perlapi.h
index d1d8dd5..0dac61a 100755 (executable)
--- a/perlapi.h
+++ b/perlapi.h
@@ -3,21 +3,28 @@
    perlvars.h and thrdvar.h.  Any changes made here will be lost!
 */
 
-#if defined(PERL_OBJECT)
-
 /* declare accessor functions for Perl variables */
 
+#if defined(PERL_OBJECT) || defined (PERL_CAPI)
+
+#if defined(PERL_OBJECT)
+#  undef  aTHXo
+#  define aTHXo                        pPerl
+#  undef  aTHXo_
+#  define aTHXo_               aTHXo,
+#endif /* PERL_OBJECT */
+
 START_EXTERN_C
 
 #undef PERLVAR
 #undef PERLVARA
 #undef PERLVARI
 #undef PERLVARIC
-#define PERLVAR(v,t)   EXTERN_C t* Perl_##v##_ptr(void *p);
+#define PERLVAR(v,t)   EXTERN_C t* Perl_##v##_ptr(pTHXo);
 #define PERLVARA(v,n,t)        typedef t PL_##v##_t[n];                        \
-                       EXTERN_C PL_##v##_t* Perl_##v##_ptr(void *p);
+                       EXTERN_C PL_##v##_t* Perl_##v##_ptr(pTHXo);
 #define PERLVARI(v,t,i)        PERLVAR(v,t)
-#define PERLVARIC(v,t,i) PERLVAR(v,t)
+#define PERLVARIC(v,t,i) PERLVAR(v, const t)
 
 #include "thrdvar.h"
 #include "intrpvar.h"
@@ -30,5 +37,5 @@ START_EXTERN_C
 
 END_EXTERN_C
 
-#endif /* PERL_OBJECT */
+#endif /* PERL_OBJECT || PERL_CAPI */