9
9
*/
10
10
11
11
#ifndef PERL_XSUB_H_
12
- #define PERL_XSUB_H_ 1
12
+ #define PERL_XSUB_H_ 1
13
13
14
14
/* first, some documentation for xsubpp-generated items */
15
15
@@ -108,13 +108,13 @@ is a lexical C<$_> in scope.
108
108
*/
109
109
110
110
#ifndef PERL_UNUSED_ARG
111
- # define PERL_UNUSED_ARG (x ) ((void )sizeof (x))
111
+ # define PERL_UNUSED_ARG (x ) ((void )sizeof (x))
112
112
#endif
113
113
#ifndef PERL_UNUSED_VAR
114
- # define PERL_UNUSED_VAR (x ) ((void )sizeof (x))
114
+ # define PERL_UNUSED_VAR (x ) ((void )sizeof (x))
115
115
#endif
116
116
117
- #define ST (off ) PL_stack_base[ax + (off)]
117
+ #define ST (off ) PL_stack_base[ax + (off)]
118
118
119
119
/* XSPROTO() is also used by SWIG like this:
120
120
*
@@ -134,36 +134,36 @@ is a lexical C<$_> in scope.
134
134
* "STATIC", ie. it exports XSUB symbols. You probably don't want that.
135
135
*/
136
136
137
- #define XSPROTO (name ) void name (pTHX_ CV* cv __attribute__unused__)
137
+ #define XSPROTO (name ) void name (pTHX_ CV* cv __attribute__unused__)
138
138
139
139
#undef XS
140
140
#undef XS_EXTERNAL
141
141
#undef XS_INTERNAL
142
142
#if defined(__CYGWIN__) && defined(USE_DYNAMIC_LOADING)
143
- # define XS_EXTERNAL (name ) __declspec(dllexport) XSPROTO(name)
144
- # define XS_INTERNAL (name ) STATIC XSPROTO (name)
143
+ # define XS_EXTERNAL (name ) __declspec(dllexport) XSPROTO(name)
144
+ # define XS_INTERNAL (name ) STATIC XSPROTO (name)
145
145
#elif defined(__cplusplus)
146
- # define XS_EXTERNAL (name ) extern " C" XSPROTO(name)
147
- # define XS_INTERNAL (name ) static XSPROTO (name)
146
+ # define XS_EXTERNAL (name ) extern " C" XSPROTO(name)
147
+ # define XS_INTERNAL (name ) static XSPROTO (name)
148
148
#elif defined(HASATTRIBUTE_UNUSED)
149
- # define XS_EXTERNAL (name ) void name (pTHX_ CV* cv __attribute__unused__)
150
- # define XS_INTERNAL (name ) STATIC void name (pTHX_ CV* cv __attribute__unused__)
149
+ # define XS_EXTERNAL (name ) void name (pTHX_ CV* cv __attribute__unused__)
150
+ # define XS_INTERNAL (name ) STATIC void name (pTHX_ CV* cv __attribute__unused__)
151
151
#else
152
- # define XS_EXTERNAL (name ) XSPROTO(name)
153
- # define XS_INTERNAL (name ) STATIC XSPROTO (name)
152
+ # define XS_EXTERNAL (name ) XSPROTO(name)
153
+ # define XS_INTERNAL (name ) STATIC XSPROTO (name)
154
154
#endif
155
155
156
156
/* We do export xsub symbols by default for the public XS macro.
157
157
* Try explicitly using XS_INTERNAL/XS_EXTERNAL instead, please. */
158
- #define XS (name ) XS_EXTERNAL(name)
158
+ #define XS (name ) XS_EXTERNAL(name)
159
159
160
- #define dAX const I32 ax = (I32)(MARK - PL_stack_base + 1 )
160
+ #define dAX const I32 ax = (I32)(MARK - PL_stack_base + 1 )
161
161
162
162
#define dAXMARK \
163
163
I32 ax = POPMARK; \
164
164
SV **mark = PL_stack_base + ax++
165
165
166
- #define dITEMS I32 items = (I32)(SP - MARK)
166
+ #define dITEMS I32 items = (I32)(SP - MARK)
167
167
168
168
#define dXSARGS \
169
169
dSP; dAXMARK; dITEMS
@@ -181,7 +181,7 @@ is a lexical C<$_> in scope.
181
181
SV **mark = PL_stack_base + ax - 1 ; dSP; dITEMS
182
182
/* dXSBOOTARGSNOVERCHK has no API in xsubpp to choose it so do
183
183
#undef dXSBOOTARGSXSAPIVERCHK
184
- #define dXSBOOTARGSXSAPIVERCHK dXSBOOTARGSNOVERCHK */
184
+ #define dXSBOOTARGSXSAPIVERCHK dXSBOOTARGSNOVERCHK */
185
185
#define dXSBOOTARGSNOVERCHK \
186
186
I32 ax = XS_SETXSUBFN_POPMARK; \
187
187
SV **mark = PL_stack_base + ax - 1 ; dSP; dITEMS
@@ -191,26 +191,26 @@ is a lexical C<$_> in scope.
191
191
? PAD_SV(PL_op->op_targ) : sv_newmortal())
192
192
193
193
/* Should be used before final PUSHi etc. if not in PPCODE section. */
194
- #define XSprePUSH (sp = PL_stack_base + ax - 1 )
194
+ #define XSprePUSH (sp = PL_stack_base + ax - 1 )
195
195
196
- #define XSANY CvXSUBANY (cv)
196
+ #define XSANY CvXSUBANY (cv)
197
197
198
- #define dXSI32 I32 ix = XSANY.any_i32
198
+ #define dXSI32 I32 ix = XSANY.any_i32
199
199
200
200
#ifdef __cplusplus
201
- # define XSINTERFACE_CVT (ret,name ) ret (*name)(...)
202
- # define XSINTERFACE_CVT_ANON (ret ) ret (*)(...)
201
+ # define XSINTERFACE_CVT (ret,name ) ret (*name)(...)
202
+ # define XSINTERFACE_CVT_ANON (ret ) ret (*)(...)
203
203
#else
204
- # define XSINTERFACE_CVT (ret,name ) ret (*name)()
205
- # define XSINTERFACE_CVT_ANON (ret ) ret (*)()
204
+ # define XSINTERFACE_CVT (ret,name ) ret (*name)()
205
+ # define XSINTERFACE_CVT_ANON (ret ) ret (*)()
206
206
#endif
207
- #define dXSFUNCTION (ret ) XSINTERFACE_CVT(ret,XSFUNCTION)
208
- #define XSINTERFACE_FUNC (ret,cv,f ) ((XSINTERFACE_CVT_ANON(ret))(f))
207
+ #define dXSFUNCTION (ret ) XSINTERFACE_CVT(ret,XSFUNCTION)
208
+ #define XSINTERFACE_FUNC (ret,cv,f ) ((XSINTERFACE_CVT_ANON(ret))(f))
209
209
#define XSINTERFACE_FUNC_SET (cv,f ) \
210
210
CvXSUBANY (cv).any_dxptr = (void (*) (pTHX_ void *))(f)
211
211
212
- #define dUNDERBAR dNOOP
213
- #define UNDERBAR find_rundefsv ()
212
+ #define dUNDERBAR dNOOP
213
+ #define UNDERBAR find_rundefsv ()
214
214
215
215
/* Simple macros to put new mortal values onto the stack. */
216
216
/* Typically used to return values from XS functions. */
@@ -313,14 +313,14 @@ Rethrows a previously caught exception. See L<perlguts/"Exception Handling">.
313
313
=cut
314
314
*/
315
315
316
- #define XST_mIV (i,v ) (ST(i) = sv_2mortal(newSViv(v)) )
317
- #define XST_mUV (i,v ) (ST(i) = sv_2mortal(newSVuv(v)) )
318
- #define XST_mNV (i,v ) (ST(i) = sv_2mortal(newSVnv(v)) )
319
- #define XST_mPV (i,v ) (ST(i) = sv_2mortal(newSVpv(v,0 )))
320
- #define XST_mPVN (i,v,n ) (ST(i) = newSVpvn_flags(v,n, SVs_TEMP))
321
- #define XST_mNO (i ) (ST(i) = &PL_sv_no )
322
- #define XST_mYES (i ) (ST(i) = &PL_sv_yes )
323
- #define XST_mUNDEF (i ) (ST(i) = &PL_sv_undef)
316
+ #define XST_mIV (i,v ) (ST(i) = sv_2mortal(newSViv(v)) )
317
+ #define XST_mUV (i,v ) (ST(i) = sv_2mortal(newSVuv(v)) )
318
+ #define XST_mNV (i,v ) (ST(i) = sv_2mortal(newSVnv(v)) )
319
+ #define XST_mPV (i,v ) (ST(i) = sv_2mortal(newSVpv(v,0 )))
320
+ #define XST_mPVN (i,v,n ) (ST(i) = newSVpvn_flags(v,n, SVs_TEMP))
321
+ #define XST_mNO (i ) (ST(i) = &PL_sv_no )
322
+ #define XST_mYES (i ) (ST(i) = &PL_sv_yes )
323
+ #define XST_mUNDEF (i ) (ST(i) = &PL_sv_undef)
324
324
325
325
#define XSRETURN (off ) \
326
326
STMT_START { \
@@ -330,17 +330,17 @@ Rethrows a previously caught exception. See L<perlguts/"Exception Handling">.
330
330
return ; \
331
331
} STMT_END
332
332
333
- #define XSRETURN_IV (v ) STMT_START { XST_mIV (0 ,v); XSRETURN (1 ); } STMT_END
334
- #define XSRETURN_UV (v ) STMT_START { XST_mUV (0 ,v); XSRETURN (1 ); } STMT_END
335
- #define XSRETURN_NV (v ) STMT_START { XST_mNV (0 ,v); XSRETURN (1 ); } STMT_END
336
- #define XSRETURN_PV (v ) STMT_START { XST_mPV (0 ,v); XSRETURN (1 ); } STMT_END
337
- #define XSRETURN_PVN (v,n ) STMT_START { XST_mPVN (0 ,v,n); XSRETURN (1 ); } STMT_END
338
- #define XSRETURN_NO STMT_START { XST_mNO (0 ); XSRETURN (1 ); } STMT_END
339
- #define XSRETURN_YES STMT_START { XST_mYES (0 ); XSRETURN (1 ); } STMT_END
340
- #define XSRETURN_UNDEF STMT_START { XST_mUNDEF (0 ); XSRETURN (1 ); } STMT_END
341
- #define XSRETURN_EMPTY STMT_START { XSRETURN (0 ); } STMT_END
333
+ #define XSRETURN_IV (v ) STMT_START { XST_mIV (0 ,v); XSRETURN (1 ); } STMT_END
334
+ #define XSRETURN_UV (v ) STMT_START { XST_mUV (0 ,v); XSRETURN (1 ); } STMT_END
335
+ #define XSRETURN_NV (v ) STMT_START { XST_mNV (0 ,v); XSRETURN (1 ); } STMT_END
336
+ #define XSRETURN_PV (v ) STMT_START { XST_mPV (0 ,v); XSRETURN (1 ); } STMT_END
337
+ #define XSRETURN_PVN (v,n ) STMT_START { XST_mPVN (0 ,v,n); XSRETURN (1 ); } STMT_END
338
+ #define XSRETURN_NO STMT_START { XST_mNO (0 ); XSRETURN (1 ); } STMT_END
339
+ #define XSRETURN_YES STMT_START { XST_mYES (0 ); XSRETURN (1 ); } STMT_END
340
+ #define XSRETURN_UNDEF STMT_START { XST_mUNDEF (0 ); XSRETURN (1 ); } STMT_END
341
+ #define XSRETURN_EMPTY STMT_START { XSRETURN (0 ); } STMT_END
342
342
343
- #define newXSproto (a,b,c,d ) newXS_flags(a,b,c,d,0 )
343
+ #define newXSproto (a,b,c,d ) newXS_flags(a,b,c,d,0 )
344
344
345
345
#ifdef XS_VERSION
346
346
# define XS_VERSION_BOOTCHECK \
@@ -361,7 +361,7 @@ Rethrows a previously caught exception. See L<perlguts/"Exception Handling">.
361
361
HS_CXT, __FILE__, items, ax, "v" PERL_API_VERSION_STRING, XS_VERSION)
362
362
#else
363
363
/* should this be a #error? if you want both checked, you better supply XS_VERSION right? */
364
- # define XS_BOTHVERSION_BOOTCHECK XS_APIVERSION_BOOTCHECK
364
+ # define XS_BOTHVERSION_BOOTCHECK XS_APIVERSION_BOOTCHECK
365
365
#endif
366
366
367
367
/* private API */
@@ -374,7 +374,7 @@ Rethrows a previously caught exception. See L<perlguts/"Exception Handling">.
374
374
HS_CXT, __FILE__, "v" PERL_API_VERSION_STRING, XS_VERSION)
375
375
#else
376
376
/* should this be a #error? if you want both checked, you better supply XS_VERSION right? */
377
- # define XS_BOTHVERSION_POPMARK_BOOTCHECK XS_APIVERSION_POPMARK_BOOTCHECK
377
+ # define XS_BOTHVERSION_POPMARK_BOOTCHECK XS_APIVERSION_POPMARK_BOOTCHECK
378
378
#endif
379
379
380
380
#define XS_APIVERSION_SETXSUBFN_POPMARK_BOOTCHECK \
@@ -398,11 +398,11 @@ Rethrows a previously caught exception. See L<perlguts/"Exception Handling">.
398
398
Perl_xs_handshake (HS_KEY(TRUE , TRUE , " " , " " ) | HSf_NOCHK, HS_CXT, __FILE__)
399
399
400
400
#ifdef NO_XSLOCKS
401
- # define dXCPT dJMPENV; int rEtV = 0
402
- # define XCPT_TRY_START JMPENV_PUSH (rEtV); if (rEtV == 0 )
403
- # define XCPT_TRY_END JMPENV_POP;
404
- # define XCPT_CATCH if (rEtV != 0 )
405
- # define XCPT_RETHROW JMPENV_JUMP (rEtV)
401
+ # define dXCPT dJMPENV; int rEtV = 0
402
+ # define XCPT_TRY_START JMPENV_PUSH (rEtV); if (rEtV == 0 )
403
+ # define XCPT_TRY_END JMPENV_POP;
404
+ # define XCPT_CATCH if (rEtV != 0 )
405
+ # define XCPT_RETHROW JMPENV_JUMP (rEtV)
406
406
#endif
407
407
408
408
/*
@@ -456,42 +456,42 @@ Rethrows a previously caught exception. See L<perlguts/"Exception Handling">.
456
456
} STMT_END
457
457
458
458
#if 1 /* for compatibility */
459
- # define VTBL_sv &PL_vtbl_sv
460
- # define VTBL_env &PL_vtbl_env
461
- # define VTBL_envelem &PL_vtbl_envelem
462
- # define VTBL_sigelem &PL_vtbl_sigelem
463
- # define VTBL_pack &PL_vtbl_pack
464
- # define VTBL_packelem &PL_vtbl_packelem
465
- # define VTBL_dbline &PL_vtbl_dbline
466
- # define VTBL_isa &PL_vtbl_isa
467
- # define VTBL_isaelem &PL_vtbl_isaelem
468
- # define VTBL_arylen &PL_vtbl_arylen
469
- # define VTBL_glob &PL_vtbl_glob
470
- # define VTBL_mglob &PL_vtbl_mglob
471
- # define VTBL_nkeys &PL_vtbl_nkeys
472
- # define VTBL_taint &PL_vtbl_taint
473
- # define VTBL_substr &PL_vtbl_substr
474
- # define VTBL_vec &PL_vtbl_vec
475
- # define VTBL_pos &PL_vtbl_pos
476
- # define VTBL_bm &PL_vtbl_bm
477
- # define VTBL_fm &PL_vtbl_fm
478
- # define VTBL_uvar &PL_vtbl_uvar
479
- # define VTBL_defelem &PL_vtbl_defelem
480
- # define VTBL_regexp &PL_vtbl_regexp
481
- # define VTBL_regdata &PL_vtbl_regdata
482
- # define VTBL_regdatum &PL_vtbl_regdatum
459
+ # define VTBL_sv &PL_vtbl_sv
460
+ # define VTBL_env &PL_vtbl_env
461
+ # define VTBL_envelem &PL_vtbl_envelem
462
+ # define VTBL_sigelem &PL_vtbl_sigelem
463
+ # define VTBL_pack &PL_vtbl_pack
464
+ # define VTBL_packelem &PL_vtbl_packelem
465
+ # define VTBL_dbline &PL_vtbl_dbline
466
+ # define VTBL_isa &PL_vtbl_isa
467
+ # define VTBL_isaelem &PL_vtbl_isaelem
468
+ # define VTBL_arylen &PL_vtbl_arylen
469
+ # define VTBL_glob &PL_vtbl_glob
470
+ # define VTBL_mglob &PL_vtbl_mglob
471
+ # define VTBL_nkeys &PL_vtbl_nkeys
472
+ # define VTBL_taint &PL_vtbl_taint
473
+ # define VTBL_substr &PL_vtbl_substr
474
+ # define VTBL_vec &PL_vtbl_vec
475
+ # define VTBL_pos &PL_vtbl_pos
476
+ # define VTBL_bm &PL_vtbl_bm
477
+ # define VTBL_fm &PL_vtbl_fm
478
+ # define VTBL_uvar &PL_vtbl_uvar
479
+ # define VTBL_defelem &PL_vtbl_defelem
480
+ # define VTBL_regexp &PL_vtbl_regexp
481
+ # define VTBL_regdata &PL_vtbl_regdata
482
+ # define VTBL_regdatum &PL_vtbl_regdatum
483
483
# ifdef USE_LOCALE_COLLATE
484
- # define VTBL_collxfrm &PL_vtbl_collxfrm
484
+ # define VTBL_collxfrm &PL_vtbl_collxfrm
485
485
# endif
486
- # define VTBL_amagic &PL_vtbl_amagic
487
- # define VTBL_amagicelem &PL_vtbl_amagicelem
486
+ # define VTBL_amagic &PL_vtbl_amagic
487
+ # define VTBL_amagicelem &PL_vtbl_amagicelem
488
488
#endif
489
489
490
490
#if defined(MULTIPLICITY) && !defined(PERL_NO_GET_CONTEXT) && !defined(PERL_CORE)
491
491
# undef aTHX
492
492
# undef aTHX_
493
- # define aTHX PERL_GET_THX
494
- # define aTHX_ aTHX,
493
+ # define aTHX PERL_GET_THX
494
+ # define aTHX_ aTHX,
495
495
#endif
496
496
497
497
#if defined(PERL_IMPLICIT_SYS) && !defined(PERL_CORE)
0 commit comments