summaryrefslogtreecommitdiff
path: root/perlapi.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2005-04-18 16:18:30 +0300
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2005-04-21 15:38:30 +0000
commit27da23d53ccce622bc51822f59df8def79b4df95 (patch)
tree1202440e0fbf7a2fc1bb54993d11cda7b245f1b4 /perlapi.c
parentec0624293b57ae07d6b2c32bae099d4f163e7e07 (diff)
downloadperl-27da23d53ccce622bc51822f59df8def79b4df95.tar.gz
Symbian port of Perl
Message-ID: <B356D8F434D20B40A8CEDAEC305A1F2453D653@esebe105.NOE.Nokia.com> p4raw-id: //depot/perl@24271
Diffstat (limited to 'perlapi.c')
-rw-r--r--perlapi.c37
1 files changed, 32 insertions, 5 deletions
diff --git a/perlapi.c b/perlapi.c
index e0bf9fbfdb..b1ed782f38 100644
--- a/perlapi.c
+++ b/perlapi.c
@@ -34,14 +34,17 @@ START_EXTERN_C
#undef PERLVARA
#undef PERLVARI
#undef PERLVARIC
+#undef PERLVARISC
#define PERLVAR(v,t) t* Perl_##v##_ptr(pTHX) \
- { return &(aTHX->v); }
+ { dVAR; return &(aTHX->v); }
#define PERLVARA(v,n,t) PL_##v##_t* Perl_##v##_ptr(pTHX) \
- { return &(aTHX->v); }
+ { dVAR; return &(aTHX->v); }
#define PERLVARI(v,t,i) PERLVAR(v,t)
#define PERLVARIC(v,t,i) PERLVAR(v, const t)
+#define PERLVARISC(v,i) PL_##v##_t* Perl_##v##_ptr(pTHX) \
+ { dVAR; return &(aTHX->v); }
#include "thrdvar.h"
#include "intrpvar.h"
@@ -49,18 +52,42 @@ START_EXTERN_C
#undef PERLVAR
#undef PERLVARA
#define PERLVAR(v,t) t* Perl_##v##_ptr(pTHX) \
- { return &(PL_##v); }
+ { dVAR; return &(PL_##v); }
#define PERLVARA(v,n,t) PL_##v##_t* Perl_##v##_ptr(pTHX) \
- { return &(PL_##v); }
+ { dVAR; return &(PL_##v); }
#undef PERLVARIC
-#define PERLVARIC(v,t,i) const t* Perl_##v##_ptr(pTHX) \
+#undef PERLVARISC
+#define PERLVARIC(v,t,i) \
+ const t* Perl_##v##_ptr(pTHX) \
{ return (const t *)&(PL_##v); }
+#define PERLVARISC(v,i) PL_##v##_t* Perl_##v##_ptr(pTHX) \
+ { dVAR; return &(PL_##v); }
#include "perlvars.h"
#undef PERLVAR
#undef PERLVARA
#undef PERLVARI
#undef PERLVARIC
+#undef PERLVARISC
+
+#ifndef PERL_GLOBAL_STRUCT
+/* A few evil special cases. Could probably macrofy this. */
+#undef PL_ppaddr
+#undef PL_check
+#undef PL_fold_locale
+Perl_ppaddr_t** Perl_Gppaddr_ptr(pTHX) {
+ static const Perl_ppaddr_t* ppaddr_ptr = PL_ppaddr;
+ return (Perl_ppaddr_t**)&ppaddr_ptr;
+}
+Perl_check_t** Perl_Gcheck_ptr(pTHX) {
+ static const Perl_check_t* check_ptr = PL_check;
+ return (Perl_check_t**)&check_ptr;
+}
+unsigned char** Perl_Gfold_locale_ptr(pTHX) {
+ static const unsigned char* fold_locale_ptr = PL_fold_locale;
+ return (unsigned char**)&fold_locale_ptr;
+}
+#endif
END_EXTERN_C