| 1 | #ifdef CAN_PROTOTYPE |
| 2 | #define XSdec(x) XS(x) |
| 3 | #else |
| 4 | #define XSdec(x) void x() |
| 5 | #endif |
| 6 | |
| 7 | #ifndef PATCHLEVEL |
| 8 | #include <patchlevel.h> |
| 9 | #endif |
| 10 | |
| 11 | #if defined(PATCHLEVEL) && (PATCHLEVEL < 5) |
| 12 | #define PL_sv_undef sv_undef |
| 13 | #define PL_tainting tainting |
| 14 | #define PL_tainted tainted |
| 15 | #define PL_stack_base stack_base |
| 16 | #define PL_stack_sp stack_sp |
| 17 | #define PL_curcop curcop |
| 18 | #endif |
| 19 | |
| 20 | #ifndef CopSTASH |
| 21 | #define CopSTASH(c) c->cop_stash |
| 22 | #define CopSTASH_set(c,h) (CopSTASH(c) = h) |
| 23 | #endif |
| 24 | |
| 25 | #ifndef dTHX |
| 26 | #define dTHX dTHR |
| 27 | #endif |
| 28 | |
| 29 | #ifndef dTHR |
| 30 | #define dTHR int maybeTHR |
| 31 | #endif |
| 32 | |
| 33 | #ifndef ERRSV |
| 34 | #define ERRSV GvSV(errgv) |
| 35 | #endif |
| 36 | |
| 37 | #ifndef aTHX_ |
| 38 | #define aTHX_ |
| 39 | #endif |
| 40 | |
| 41 | #ifdef dirty |
| 42 | #undef dirty |
| 43 | #endif |
| 44 | #ifdef bufptr |
| 45 | #undef bufptr |
| 46 | #endif |
| 47 | #ifdef colors |
| 48 | #undef colors |
| 49 | #endif |
| 50 | |
| 51 | #ifdef na |
| 52 | #if PATCHLEVEL >= 5 |
| 53 | #undef na |
| 54 | #endif |
| 55 | #endif |
| 56 | |
| 57 | |
| 58 | #define Tcl_Interp HV |
| 59 | #define LangCallback SV |
| 60 | #define Arg SV * |
| 61 | #define Var SV * |
| 62 | #define LangResultSave AV |
| 63 | #define Tcl_Command struct Lang_CmdInfo * |
| 64 | #define Tcl_RegExp regexp * |
| 65 | #define Tcl_Obj SV |
| 66 | #define Tcl_DString SV * |
| 67 | |
| 68 | #ifndef PerlIO |
| 69 | #define PerlIO FILE |
| 70 | #define PerlIO_stderr() stderr |
| 71 | #define PerlIO_printf fprintf |
| 72 | #define PerlIO_flush(f) Fflush(f) |
| 73 | #define PerlIO_vprintf(f,fmt,a) vfprintf(f,fmt,a) |
| 74 | #define PerlIO_putc(f,c) fputc(c,f) |
| 75 | #define PerlIO_fileno(f) fileno(f) |
| 76 | |
| 77 | /* Now our interface to Configure's FILE_xxx macros */ |
| 78 | |
| 79 | #ifdef USE_STDIO_PTR |
| 80 | #define PerlIO_has_cntptr(f) 1 |
| 81 | #define PerlIO_get_ptr(f) FILE_ptr(f) |
| 82 | #define PerlIO_get_cnt(f) FILE_cnt(f) |
| 83 | |
| 84 | #ifdef FILE_CNT_LVALUE |
| 85 | #define PerlIO_canset_cnt(f) 1 |
| 86 | #ifdef FILE_PTR_LVALUE |
| 87 | #define PerlIO_fast_gets(f) 1 |
| 88 | #endif |
| 89 | #define PerlIO_set_cnt(f,c) (FILE_cnt(f) = (c)) |
| 90 | #else |
| 91 | #define PerlIO_canset_cnt(f) 0 |
| 92 | #define PerlIO_set_cnt(f,c) abort() |
| 93 | #endif |
| 94 | |
| 95 | #ifdef FILE_PTR_LVALUE |
| 96 | #define PerlIO_set_ptrcnt(f,p,c) (FILE_ptr(f) = (p), PerlIO_set_cnt(f,c)) |
| 97 | #else |
| 98 | #define PerlIO_set_ptrcnt(f,p,c) abort() |
| 99 | #endif |
| 100 | |
| 101 | #else /* USE_STDIO_PTR */ |
| 102 | |
| 103 | #define PerlIO_has_cntptr(f) 0 |
| 104 | #define PerlIO_get_cnt(f) (abort(),0) |
| 105 | #define PerlIO_get_ptr(f) (abort(),0) |
| 106 | #define PerlIO_set_cnt(f,c) abort() |
| 107 | #define PerlIO_set_ptrcnt(f,p,c) abort() |
| 108 | |
| 109 | #endif /* USE_STDIO_PTR */ |
| 110 | |
| 111 | #endif |