Perl / perl5

🐪 The Perl programming language
https://dev.perl.org/perl5/
Other
1.91k stars 544 forks source link

[PATCH] remove redundant PERL_EXPORT_C and PERL_XS_EXPORT_C macros #14697

Closed p5pRT closed 8 years ago

p5pRT commented 9 years ago

Migrated from rt.perl.org#125147 (status was 'resolved')

Searchable as RT125147$

p5pRT commented 9 years ago

From @bulk88

Created by @bulk88

For 5.23. See attached patch.

Perl Info ``` Flags: category=core severity=low Site configuration information for perl 5.21.12: Configured by Owner at Sun May 10 14:57:08 2015. Summary of my perl5 (revision 5 version 21 subversion 12) configuration: Derived from: 4d372299b1277414fd5be2324b8b67755273b9fb Platform: osname=MSWin32, osvers=5.1, archname=MSWin32-x86-multi-thread uname='' config_args='undef' hint=recommended, useposix=true, d_sigaction=undef useithreads=define, usemultiplicity=define use64bitint=undef, use64bitall=undef, uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cl', ccflags ='-nologo -GF -W3 -O1 -MD -Zi -DNDEBUG -GL -DWIN32 -D_CONSOLE -DNO_STRICT -DPERL_TEXTMODE_SCRIPTS -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -D_USE_32BIT_TIME_T', optimize='-O1 -MD -Zi -DNDEBUG -GL', cppflags='-DWIN32' ccversion='13.10.6030', gccversion='', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234, doublekind=3 d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=8, longdblkind=0 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='__int64', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='link', ldflags ='-nologo -nodefaultlib -debug -opt:ref,icf -ltcg -libpath:"c:\perl\lib\CORE" -machine:x86' libpth=\lib libs=oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib netapi32.lib uuid.lib ws2_32.lib mpr.lib winmm.lib version.lib odbc32.lib odbccp32.lib comctl32.lib msvcrt.lib perllibs=oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib netapi32.lib uuid.lib ws2_32.lib mpr.lib winmm.lib version.lib odbc32.lib odbccp32.lib comctl32.lib msvcrt.lib libc=msvcrt.lib, so=dll, useshrplib=true, libperl=perl521.lib gnulibc_version='' Dynamic Linking: dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' ' cccdlflags=' ', lddlflags='-dll -nologo -nodefaultlib -debug -opt:ref,icf -ltcg -libpath:"c:\perl\lib\CORE" -machine:x86' Locally applied patches: uncommitted-changes @INC for perl 5.21.12: C:/perl521/srcnewb4opt/lib . Environment for perl 5.21.12: HOME (unset) LANG (unset) LANGUAGE (unset) LD_LIBRARY_PATH (unset) LOGDIR (unset) PATH=C:\Program Files\Dr. Memory\bin;C:\sperl\c\bin;C:\WINDOWS\system32;C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin;C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\IDE;C:\WINDOWS;C:\Program Files\Git\cmd;C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\Tools\bin;C:\perl\bin PERL_BADLANG (unset) PERL_JSON_BACKEND=Cpanel::JSON::XS PERL_YAML_BACKEND=YAML SHELL (unset) ```
p5pRT commented 9 years ago

From @bulk88

0001-remove-redundant-PERL_EXPORT_C-and-PERL_XS_EXPORT_C-.patch ```diff From c2854f2ad23919c10b6166cede87cbb0a851d437 Mon Sep 17 00:00:00 2001 From: Daniel Dragan Date: Sun, 10 May 2015 15:16:35 -0400 Subject: [PATCH] remove redundant PERL_EXPORT_C and PERL_XS_EXPORT_C macros These 2 macros were created for the Symbian port in commit "Symbian port of Perl" to replace a direct "extern" token. I guess the author was unaware of PERL_CALLCONV. PERL_CALLCONV is the official macro to use. PERL_XS_EXPORT_C and PERL_EXPORT_C have no usage on cpan grep except for modules with direct copies of core headers. A defect of using PERL_EXPORT_C and PERL_XS_EXPORT_C instead of PERL_CALLCONV is that win32/win32.h has no knowledge of the 2 macros and doesn't set them, and os/os2ish.h doesn't either. On Win32, since the unix defaults are used instead of Win32 specific "__declspec(dllimport)" token, XS modules use indirect function stubs in each XS module placed by the CC to call into perl5**.dll instead of directly calls the core C functions. I this in observed in XS-Typemap's DLL. To simplify the API, and to decrease the amount of macros needing to implemented to support each platform, just remove the 2 macros. Since perl.h's fallback defaults for PERL_CALLCONV are very late in perl.h, they need to be moved up before function declarations start in perlio.h (perlio.h is included from iperlsys.h). win32iop.h contains the "PerlIO" and SV" tokens, so perlio.h must be included before win32iop.h is. Including perlio.h so early in win32.h, causes PERL_CALLCONV not be defined since Win32 platform uses the fallback in perl.h, since win32.h doesn't always define PERL_CALLCONV and sometimes relies on the fallback. Since win32iop.h contains alot of declarations, it belongs with other declarations such as those in proto.h so move it from win32.h to perl.h. the "free" token in struct regexp_engine conflicts with win32iop's "#define free win32_free" so rename that member. --- handy.h | 6 +- perl.h | 79 ++++++++----------- perlio.h | 114 ++++++++++++++-------------- perliol.h | 210 +++++++++++++++++++++++++------------------------- regexp.h | 2 +- symbian/symbianish.h | 4 - win32/win32.h | 8 -- 7 files changed, 199 insertions(+), 224 deletions(-) diff --git a/handy.h b/handy.h index 89055c5..7151072 100644 --- a/handy.h +++ b/handy.h @@ -1966,11 +1966,11 @@ PoisonWith(0xEF) for catching access to freed memory. * - lots of ENV reads */ -PERL_EXPORT_C Malloc_t Perl_mem_log_alloc(const UV n, const UV typesize, const char *type_name, Malloc_t newalloc, const char *filename, const int linenumber, const char *funcname); +PERL_CALLCONV Malloc_t Perl_mem_log_alloc(const UV n, const UV typesize, const char *type_name, Malloc_t newalloc, const char *filename, const int linenumber, const char *funcname); -PERL_EXPORT_C Malloc_t Perl_mem_log_realloc(const UV n, const UV typesize, const char *type_name, Malloc_t oldalloc, Malloc_t newalloc, const char *filename, const int linenumber, const char *funcname); +PERL_CALLCONV Malloc_t Perl_mem_log_realloc(const UV n, const UV typesize, const char *type_name, Malloc_t oldalloc, Malloc_t newalloc, const char *filename, const int linenumber, const char *funcname); -PERL_EXPORT_C Malloc_t Perl_mem_log_free(Malloc_t oldalloc, const char *filename, const int linenumber, const char *funcname); +PERL_CALLCONV Malloc_t Perl_mem_log_free(Malloc_t oldalloc, const char *filename, const int linenumber, const char *funcname); # ifdef PERL_CORE # ifndef PERL_MEM_LOG_NOIMPL diff --git a/perl.h b/perl.h index dcb184b..63bb377 100644 --- a/perl.h +++ b/perl.h @@ -231,7 +231,7 @@ Perl_pregfree(aTHX_ (prog)) #define CALLREGFREE_PVT(prog) \ - if(prog) RX_ENGINE(prog)->free(aTHX_ (prog)) + if(prog) RX_ENGINE(prog)->rxfree(aTHX_ (prog)) #define CALLREG_NUMBUF_FETCH(rx,paren,usesv) \ RX_ENGINE(rx)->numbered_buff_FETCH(aTHX_ (rx),(paren),(usesv)) @@ -496,26 +496,6 @@ # endif #endif -/* Some platforms require marking function declarations - * for them to be exportable. Used in perlio.h, proto.h - * is handled either by the makedef.pl or by defining the - * PERL_CALLCONV to be something special. See also the - * definition of XS() in XSUB.h. */ -#ifndef PERL_EXPORT_C -# ifdef __cplusplus -# define PERL_EXPORT_C extern "C" -# else -# define PERL_EXPORT_C extern -# endif -#endif -#ifndef PERL_XS_EXPORT_C -# ifdef __cplusplus -# define PERL_XS_EXPORT_C extern "C" -# else -# define PERL_XS_EXPORT_C -# endif -#endif - #if defined(__GNUC__) && !defined(PERL_GCC_BRACE_GROUPS_FORBIDDEN) && !defined(__cplusplus) # ifndef PERL_USE_GCC_BRACE_GROUPS # define PERL_USE_GCC_BRACE_GROUPS @@ -3684,6 +3664,30 @@ typedef struct crypt_data { /* straight from /usr/include/crypt.h */ #endif /* threading */ #endif /* AIX */ +#ifndef PERL_CALLCONV +# ifdef __cplusplus +# define PERL_CALLCONV extern "C" +# else +# define PERL_CALLCONV +# endif +#endif +#ifndef PERL_CALLCONV_NO_RET +# define PERL_CALLCONV_NO_RET PERL_CALLCONV +#endif + +/* PERL_STATIC_NO_RET is supposed to be equivalent to STATIC on builds that + dont have a noreturn as a declaration specifier +*/ +#ifndef PERL_STATIC_NO_RET +# define PERL_STATIC_NO_RET STATIC +#endif +/* PERL_STATIC_NO_RET is supposed to be equivalent to PERL_STATIC_INLINE on + builds that dont have a noreturn as a declaration specifier +*/ +#ifndef PERL_STATIC_INLINE_NO_RET +# define PERL_STATIC_INLINE_NO_RET PERL_STATIC_INLINE +#endif + #if !defined(OS2) # include "iperlsys.h" #endif @@ -5469,31 +5473,6 @@ struct tempsym; /* defined in pp_pack.c */ #include "thread.h" #include "pp.h" -#ifndef PERL_CALLCONV -# ifdef __cplusplus -# define PERL_CALLCONV extern "C" -# else -# define PERL_CALLCONV -# endif -#endif -#ifndef PERL_CALLCONV_NO_RET -# define PERL_CALLCONV_NO_RET PERL_CALLCONV -#endif - -/* PERL_STATIC_NO_RET is supposed to be equivalent to STATIC on builds that - dont have a noreturn as a declaration specifier -*/ -#ifndef PERL_STATIC_NO_RET -# define PERL_STATIC_NO_RET STATIC -#endif -/* PERL_STATIC_NO_RET is supposed to be equivalent to PERL_STATIC_INLINE on - builds that dont have a noreturn as a declaration specifier -*/ -#ifndef PERL_STATIC_INLINE_NO_RET -# define PERL_STATIC_INLINE_NO_RET PERL_STATIC_INLINE -#endif - - #undef PERL_CKDEF #undef PERL_PPDEF #define PERL_CKDEF(s) PERL_CALLCONV OP *s (pTHX_ OP *o); @@ -5503,6 +5482,14 @@ struct tempsym; /* defined in pp_pack.c */ # include "malloc_ctl.h" #endif +/* + * This provides a layer of functions and macros to ensure extensions will + * get to use the same RTL functions as the core. + */ +#if defined(WIN32) +# include "win32iop.h" +#endif + #include "proto.h" /* this has structure inits, so it cannot be included before here */ diff --git a/perlio.h b/perlio.h index 55e0ce3..8e700fe 100644 --- a/perlio.h +++ b/perlio.h @@ -96,15 +96,15 @@ typedef PerlIOl *PerlIO; #define PERLIO_FUNCS_CAST(funcs) (funcs) #endif -PERL_EXPORT_C void PerlIO_define_layer(pTHX_ PerlIO_funcs *tab); -PERL_EXPORT_C PerlIO_funcs *PerlIO_find_layer(pTHX_ const char *name, +PERL_CALLCONV void PerlIO_define_layer(pTHX_ PerlIO_funcs *tab); +PERL_CALLCONV PerlIO_funcs *PerlIO_find_layer(pTHX_ const char *name, STRLEN len, int load); -PERL_EXPORT_C PerlIO *PerlIO_push(pTHX_ PerlIO *f, PERLIO_FUNCS_DECL(*tab), +PERL_CALLCONV PerlIO *PerlIO_push(pTHX_ PerlIO *f, PERLIO_FUNCS_DECL(*tab), const char *mode, SV *arg); -PERL_EXPORT_C void PerlIO_pop(pTHX_ PerlIO *f); -PERL_EXPORT_C AV* PerlIO_get_layers(pTHX_ PerlIO *f); -PERL_EXPORT_C void PerlIO_clone(pTHX_ PerlInterpreter *proto, +PERL_CALLCONV void PerlIO_pop(pTHX_ PerlIO *f); +PERL_CALLCONV AV* PerlIO_get_layers(pTHX_ PerlIO *f); +PERL_CALLCONV void PerlIO_clone(pTHX_ PerlInterpreter *proto, CLONE_PARAMS *param); #endif /* PerlIO */ @@ -202,161 +202,161 @@ START_EXTERN_C # endif #endif #ifndef PerlIO_init -PERL_EXPORT_C void PerlIO_init(pTHX); +PERL_CALLCONV void PerlIO_init(pTHX); #endif #ifndef PerlIO_stdoutf -PERL_EXPORT_C int PerlIO_stdoutf(const char *, ...) +PERL_CALLCONV int PerlIO_stdoutf(const char *, ...) __attribute__format__(__printf__, 1, 2); #endif #ifndef PerlIO_puts -PERL_EXPORT_C int PerlIO_puts(PerlIO *, const char *); +PERL_CALLCONV int PerlIO_puts(PerlIO *, const char *); #endif #ifndef PerlIO_open -PERL_EXPORT_C PerlIO *PerlIO_open(const char *, const char *); +PERL_CALLCONV PerlIO *PerlIO_open(const char *, const char *); #endif #ifndef PerlIO_openn -PERL_EXPORT_C PerlIO *PerlIO_openn(pTHX_ const char *layers, const char *mode, +PERL_CALLCONV PerlIO *PerlIO_openn(pTHX_ const char *layers, const char *mode, int fd, int imode, int perm, PerlIO *old, int narg, SV **arg); #endif #ifndef PerlIO_eof -PERL_EXPORT_C int PerlIO_eof(PerlIO *); +PERL_CALLCONV int PerlIO_eof(PerlIO *); #endif #ifndef PerlIO_error -PERL_EXPORT_C int PerlIO_error(PerlIO *); +PERL_CALLCONV int PerlIO_error(PerlIO *); #endif #ifndef PerlIO_clearerr -PERL_EXPORT_C void PerlIO_clearerr(PerlIO *); +PERL_CALLCONV void PerlIO_clearerr(PerlIO *); #endif #ifndef PerlIO_getc -PERL_EXPORT_C int PerlIO_getc(PerlIO *); +PERL_CALLCONV int PerlIO_getc(PerlIO *); #endif #ifndef PerlIO_putc -PERL_EXPORT_C int PerlIO_putc(PerlIO *, int); +PERL_CALLCONV int PerlIO_putc(PerlIO *, int); #endif #ifndef PerlIO_ungetc -PERL_EXPORT_C int PerlIO_ungetc(PerlIO *, int); +PERL_CALLCONV int PerlIO_ungetc(PerlIO *, int); #endif #ifndef PerlIO_fdopen -PERL_EXPORT_C PerlIO *PerlIO_fdopen(int, const char *); +PERL_CALLCONV PerlIO *PerlIO_fdopen(int, const char *); #endif #ifndef PerlIO_importFILE -PERL_EXPORT_C PerlIO *PerlIO_importFILE(FILE *, const char *); +PERL_CALLCONV PerlIO *PerlIO_importFILE(FILE *, const char *); #endif #ifndef PerlIO_exportFILE -PERL_EXPORT_C FILE *PerlIO_exportFILE(PerlIO *, const char *); +PERL_CALLCONV FILE *PerlIO_exportFILE(PerlIO *, const char *); #endif #ifndef PerlIO_findFILE -PERL_EXPORT_C FILE *PerlIO_findFILE(PerlIO *); +PERL_CALLCONV FILE *PerlIO_findFILE(PerlIO *); #endif #ifndef PerlIO_releaseFILE -PERL_EXPORT_C void PerlIO_releaseFILE(PerlIO *, FILE *); +PERL_CALLCONV void PerlIO_releaseFILE(PerlIO *, FILE *); #endif #ifndef PerlIO_read -PERL_EXPORT_C SSize_t PerlIO_read(PerlIO *, void *, Size_t); +PERL_CALLCONV SSize_t PerlIO_read(PerlIO *, void *, Size_t); #endif #ifndef PerlIO_unread -PERL_EXPORT_C SSize_t PerlIO_unread(PerlIO *, const void *, Size_t); +PERL_CALLCONV SSize_t PerlIO_unread(PerlIO *, const void *, Size_t); #endif #ifndef PerlIO_write -PERL_EXPORT_C SSize_t PerlIO_write(PerlIO *, const void *, Size_t); +PERL_CALLCONV SSize_t PerlIO_write(PerlIO *, const void *, Size_t); #endif #ifndef PerlIO_setlinebuf -PERL_EXPORT_C void PerlIO_setlinebuf(PerlIO *); +PERL_CALLCONV void PerlIO_setlinebuf(PerlIO *); #endif #ifndef PerlIO_printf -PERL_EXPORT_C int PerlIO_printf(PerlIO *, const char *, ...) +PERL_CALLCONV int PerlIO_printf(PerlIO *, const char *, ...) __attribute__format__(__printf__, 2, 3); #endif #ifndef PerlIO_vprintf -PERL_EXPORT_C int PerlIO_vprintf(PerlIO *, const char *, va_list); +PERL_CALLCONV int PerlIO_vprintf(PerlIO *, const char *, va_list); #endif #ifndef PerlIO_tell -PERL_EXPORT_C Off_t PerlIO_tell(PerlIO *); +PERL_CALLCONV Off_t PerlIO_tell(PerlIO *); #endif #ifndef PerlIO_seek -PERL_EXPORT_C int PerlIO_seek(PerlIO *, Off_t, int); +PERL_CALLCONV int PerlIO_seek(PerlIO *, Off_t, int); #endif #ifndef PerlIO_rewind -PERL_EXPORT_C void PerlIO_rewind(PerlIO *); +PERL_CALLCONV void PerlIO_rewind(PerlIO *); #endif #ifndef PerlIO_has_base -PERL_EXPORT_C int PerlIO_has_base(PerlIO *); +PERL_CALLCONV int PerlIO_has_base(PerlIO *); #endif #ifndef PerlIO_has_cntptr -PERL_EXPORT_C int PerlIO_has_cntptr(PerlIO *); +PERL_CALLCONV int PerlIO_has_cntptr(PerlIO *); #endif #ifndef PerlIO_fast_gets -PERL_EXPORT_C int PerlIO_fast_gets(PerlIO *); +PERL_CALLCONV int PerlIO_fast_gets(PerlIO *); #endif #ifndef PerlIO_canset_cnt -PERL_EXPORT_C int PerlIO_canset_cnt(PerlIO *); +PERL_CALLCONV int PerlIO_canset_cnt(PerlIO *); #endif #ifndef PerlIO_get_ptr -PERL_EXPORT_C STDCHAR *PerlIO_get_ptr(PerlIO *); +PERL_CALLCONV STDCHAR *PerlIO_get_ptr(PerlIO *); #endif #ifndef PerlIO_get_cnt -PERL_EXPORT_C SSize_t PerlIO_get_cnt(PerlIO *); +PERL_CALLCONV SSize_t PerlIO_get_cnt(PerlIO *); #endif #ifndef PerlIO_set_cnt -PERL_EXPORT_C void PerlIO_set_cnt(PerlIO *, SSize_t); +PERL_CALLCONV void PerlIO_set_cnt(PerlIO *, SSize_t); #endif #ifndef PerlIO_set_ptrcnt -PERL_EXPORT_C void PerlIO_set_ptrcnt(PerlIO *, STDCHAR *, SSize_t); +PERL_CALLCONV void PerlIO_set_ptrcnt(PerlIO *, STDCHAR *, SSize_t); #endif #ifndef PerlIO_get_base -PERL_EXPORT_C STDCHAR *PerlIO_get_base(PerlIO *); +PERL_CALLCONV STDCHAR *PerlIO_get_base(PerlIO *); #endif #ifndef PerlIO_get_bufsiz -PERL_EXPORT_C SSize_t PerlIO_get_bufsiz(PerlIO *); +PERL_CALLCONV SSize_t PerlIO_get_bufsiz(PerlIO *); #endif #ifndef PerlIO_tmpfile -PERL_EXPORT_C PerlIO *PerlIO_tmpfile(void); +PERL_CALLCONV PerlIO *PerlIO_tmpfile(void); #endif #ifndef PerlIO_stdin -PERL_EXPORT_C PerlIO *PerlIO_stdin(void); +PERL_CALLCONV PerlIO *PerlIO_stdin(void); #endif #ifndef PerlIO_stdout -PERL_EXPORT_C PerlIO *PerlIO_stdout(void); +PERL_CALLCONV PerlIO *PerlIO_stdout(void); #endif #ifndef PerlIO_stderr -PERL_EXPORT_C PerlIO *PerlIO_stderr(void); +PERL_CALLCONV PerlIO *PerlIO_stderr(void); #endif #ifndef PerlIO_getpos -PERL_EXPORT_C int PerlIO_getpos(PerlIO *, SV *); +PERL_CALLCONV int PerlIO_getpos(PerlIO *, SV *); #endif #ifndef PerlIO_setpos -PERL_EXPORT_C int PerlIO_setpos(PerlIO *, SV *); +PERL_CALLCONV int PerlIO_setpos(PerlIO *, SV *); #endif #ifndef PerlIO_fdupopen -PERL_EXPORT_C PerlIO *PerlIO_fdupopen(pTHX_ PerlIO *, CLONE_PARAMS *, int); +PERL_CALLCONV PerlIO *PerlIO_fdupopen(pTHX_ PerlIO *, CLONE_PARAMS *, int); #endif #if !defined(PerlIO_modestr) && !defined(PERLIO_IS_STDIO) -PERL_EXPORT_C char *PerlIO_modestr(PerlIO *, char *buf); +PERL_CALLCONV char *PerlIO_modestr(PerlIO *, char *buf); #endif #ifndef PerlIO_isutf8 -PERL_EXPORT_C int PerlIO_isutf8(PerlIO *); +PERL_CALLCONV int PerlIO_isutf8(PerlIO *); #endif #ifndef PerlIO_apply_layers -PERL_EXPORT_C int PerlIO_apply_layers(pTHX_ PerlIO *f, const char *mode, +PERL_CALLCONV int PerlIO_apply_layers(pTHX_ PerlIO *f, const char *mode, const char *names); #endif #ifndef PerlIO_binmode -PERL_EXPORT_C int PerlIO_binmode(pTHX_ PerlIO *f, int iotype, int omode, +PERL_CALLCONV int PerlIO_binmode(pTHX_ PerlIO *f, int iotype, int omode, const char *names); #endif #ifndef PerlIO_getname -PERL_EXPORT_C char *PerlIO_getname(PerlIO *, char *); +PERL_CALLCONV char *PerlIO_getname(PerlIO *, char *); #endif -PERL_EXPORT_C void PerlIO_destruct(pTHX); +PERL_CALLCONV void PerlIO_destruct(pTHX); -PERL_EXPORT_C int PerlIO_intmode2str(int rawmode, char *mode, int *writing); +PERL_CALLCONV int PerlIO_intmode2str(int rawmode, char *mode, int *writing); #ifdef PERLIO_LAYERS -PERL_EXPORT_C void PerlIO_cleanup(pTHX); +PERL_CALLCONV void PerlIO_cleanup(pTHX); -PERL_EXPORT_C void PerlIO_debug(const char *fmt, ...) +PERL_CALLCONV void PerlIO_debug(const char *fmt, ...) __attribute__format__(__printf__, 1, 2); typedef struct PerlIO_list_s PerlIO_list_t; diff --git a/perliol.h b/perliol.h index b8c0eae..d15c937 100644 --- a/perliol.h +++ b/perliol.h @@ -124,8 +124,8 @@ EXTPERLIO PerlIO_funcs PerlIO_pending; #ifdef WIN32 EXTPERLIO PerlIO_funcs PerlIO_win32; #endif -PERL_EXPORT_C PerlIO *PerlIO_allocate(pTHX); -PERL_EXPORT_C SV *PerlIO_arg_fetch(PerlIO_list_t *av, IV n); +PERL_CALLCONV PerlIO *PerlIO_allocate(pTHX); +PERL_CALLCONV SV *PerlIO_arg_fetch(PerlIO_list_t *av, IV n); #define PerlIOArg PerlIO_arg_fetch(layers,n) #ifdef PERLIO_USING_CRLF @@ -150,28 +150,28 @@ typedef struct { IV oneword; /* Emergency buffer */ } PerlIOBuf; -PERL_EXPORT_C int PerlIO_apply_layera(pTHX_ PerlIO *f, const char *mode, +PERL_CALLCONV int PerlIO_apply_layera(pTHX_ PerlIO *f, const char *mode, PerlIO_list_t *layers, IV n, IV max); -PERL_EXPORT_C int PerlIO_parse_layers(pTHX_ PerlIO_list_t *av, const char *names); -PERL_EXPORT_C PerlIO_funcs *PerlIO_layer_fetch(pTHX_ PerlIO_list_t *av, IV n, PerlIO_funcs *def); +PERL_CALLCONV int PerlIO_parse_layers(pTHX_ PerlIO_list_t *av, const char *names); +PERL_CALLCONV PerlIO_funcs *PerlIO_layer_fetch(pTHX_ PerlIO_list_t *av, IV n, PerlIO_funcs *def); -PERL_EXPORT_C SV *PerlIO_sv_dup(pTHX_ SV *arg, CLONE_PARAMS *param); -PERL_EXPORT_C void PerlIO_cleantable(pTHX_ PerlIOl **tablep); -PERL_EXPORT_C SV * PerlIO_tab_sv(pTHX_ PerlIO_funcs *tab); -PERL_EXPORT_C void PerlIO_default_buffer(pTHX_ PerlIO_list_t *av); -PERL_EXPORT_C void PerlIO_stdstreams(pTHX); -PERL_EXPORT_C int PerlIO__close(pTHX_ PerlIO *f); -PERL_EXPORT_C PerlIO_list_t * PerlIO_resolve_layers(pTHX_ const char *layers, const char *mode, int narg, SV **args); -PERL_EXPORT_C PerlIO_funcs * PerlIO_default_layer(pTHX_ I32 n); -PERL_EXPORT_C PerlIO_list_t * PerlIO_default_layers(pTHX); -PERL_EXPORT_C PerlIO * PerlIO_reopen(const char *path, const char *mode, PerlIO *f); +PERL_CALLCONV SV *PerlIO_sv_dup(pTHX_ SV *arg, CLONE_PARAMS *param); +PERL_CALLCONV void PerlIO_cleantable(pTHX_ PerlIOl **tablep); +PERL_CALLCONV SV * PerlIO_tab_sv(pTHX_ PerlIO_funcs *tab); +PERL_CALLCONV void PerlIO_default_buffer(pTHX_ PerlIO_list_t *av); +PERL_CALLCONV void PerlIO_stdstreams(pTHX); +PERL_CALLCONV int PerlIO__close(pTHX_ PerlIO *f); +PERL_CALLCONV PerlIO_list_t * PerlIO_resolve_layers(pTHX_ const char *layers, const char *mode, int narg, SV **args); +PERL_CALLCONV PerlIO_funcs * PerlIO_default_layer(pTHX_ I32 n); +PERL_CALLCONV PerlIO_list_t * PerlIO_default_layers(pTHX); +PERL_CALLCONV PerlIO * PerlIO_reopen(const char *path, const char *mode, PerlIO *f); -PERL_EXPORT_C PerlIO_list_t *PerlIO_list_alloc(pTHX); -PERL_EXPORT_C PerlIO_list_t *PerlIO_clone_list(pTHX_ PerlIO_list_t *proto, CLONE_PARAMS *param); -PERL_EXPORT_C void PerlIO_list_free(pTHX_ PerlIO_list_t *list); -PERL_EXPORT_C void PerlIO_list_push(pTHX_ PerlIO_list_t *list, PerlIO_funcs *funcs, SV *arg); -PERL_EXPORT_C void PerlIO_list_free(pTHX_ PerlIO_list_t *list); +PERL_CALLCONV PerlIO_list_t *PerlIO_list_alloc(pTHX); +PERL_CALLCONV PerlIO_list_t *PerlIO_clone_list(pTHX_ PerlIO_list_t *proto, CLONE_PARAMS *param); +PERL_CALLCONV void PerlIO_list_free(pTHX_ PerlIO_list_t *list); +PERL_CALLCONV void PerlIO_list_push(pTHX_ PerlIO_list_t *list, PerlIO_funcs *funcs, SV *arg); +PERL_CALLCONV void PerlIO_list_free(pTHX_ PerlIO_list_t *list); /* PerlIO_teardown doesn't need exporting, but the EXTERN_C is needed * for compiling as C++. Must also match with what perl.h says. */ @@ -180,111 +180,111 @@ EXTERN_C void PerlIO_teardown(void); /*--------------------------------------------------------------------------------------*/ /* Generic, or stub layer functions */ -PERL_EXPORT_C IV PerlIOBase_binmode(pTHX_ PerlIO *f); -PERL_EXPORT_C void PerlIOBase_clearerr(pTHX_ PerlIO *f); -PERL_EXPORT_C IV PerlIOBase_close(pTHX_ PerlIO *f); -PERL_EXPORT_C PerlIO * PerlIOBase_dup(pTHX_ PerlIO *f, PerlIO *o, CLONE_PARAMS *param, int flags); -PERL_EXPORT_C IV PerlIOBase_eof(pTHX_ PerlIO *f); -PERL_EXPORT_C IV PerlIOBase_error(pTHX_ PerlIO *f); -PERL_EXPORT_C IV PerlIOBase_fileno(pTHX_ PerlIO *f); -PERL_EXPORT_C void PerlIOBase_flush_linebuf(pTHX); -PERL_EXPORT_C IV PerlIOBase_noop_fail(pTHX_ PerlIO *f); -PERL_EXPORT_C IV PerlIOBase_noop_ok(pTHX_ PerlIO *f); -PERL_EXPORT_C IV PerlIOBase_popped(pTHX_ PerlIO *f); -PERL_EXPORT_C IV PerlIOBase_pushed(pTHX_ PerlIO *f, const char *mode, SV *arg, PerlIO_funcs *tab); -PERL_EXPORT_C PerlIO * PerlIOBase_open(pTHX_ PerlIO_funcs *self, PerlIO_list_t *layers, IV n, const char *mode, int fd, int imode, int perm, PerlIO *old, int narg, SV **args); -PERL_EXPORT_C SSize_t PerlIOBase_read(pTHX_ PerlIO *f, void *vbuf, Size_t count); -PERL_EXPORT_C void PerlIOBase_setlinebuf(pTHX_ PerlIO *f); -PERL_EXPORT_C SSize_t PerlIOBase_unread(pTHX_ PerlIO *f, const void *vbuf, Size_t count); +PERL_CALLCONV IV PerlIOBase_binmode(pTHX_ PerlIO *f); +PERL_CALLCONV void PerlIOBase_clearerr(pTHX_ PerlIO *f); +PERL_CALLCONV IV PerlIOBase_close(pTHX_ PerlIO *f); +PERL_CALLCONV PerlIO * PerlIOBase_dup(pTHX_ PerlIO *f, PerlIO *o, CLONE_PARAMS *param, int flags); +PERL_CALLCONV IV PerlIOBase_eof(pTHX_ PerlIO *f); +PERL_CALLCONV IV PerlIOBase_error(pTHX_ PerlIO *f); +PERL_CALLCONV IV PerlIOBase_fileno(pTHX_ PerlIO *f); +PERL_CALLCONV void PerlIOBase_flush_linebuf(pTHX); +PERL_CALLCONV IV PerlIOBase_noop_fail(pTHX_ PerlIO *f); +PERL_CALLCONV IV PerlIOBase_noop_ok(pTHX_ PerlIO *f); +PERL_CALLCONV IV PerlIOBase_popped(pTHX_ PerlIO *f); +PERL_CALLCONV IV PerlIOBase_pushed(pTHX_ PerlIO *f, const char *mode, SV *arg, PerlIO_funcs *tab); +PERL_CALLCONV PerlIO * PerlIOBase_open(pTHX_ PerlIO_funcs *self, PerlIO_list_t *layers, IV n, const char *mode, int fd, int imode, int perm, PerlIO *old, int narg, SV **args); +PERL_CALLCONV SSize_t PerlIOBase_read(pTHX_ PerlIO *f, void *vbuf, Size_t count); +PERL_CALLCONV void PerlIOBase_setlinebuf(pTHX_ PerlIO *f); +PERL_CALLCONV SSize_t PerlIOBase_unread(pTHX_ PerlIO *f, const void *vbuf, Size_t count); /* Buf */ -PERL_EXPORT_C Size_t PerlIOBuf_bufsiz(pTHX_ PerlIO *f); -PERL_EXPORT_C IV PerlIOBuf_close(pTHX_ PerlIO *f); -PERL_EXPORT_C PerlIO * PerlIOBuf_dup(pTHX_ PerlIO *f, PerlIO *o, CLONE_PARAMS *param, int flags); -PERL_EXPORT_C IV PerlIOBuf_fill(pTHX_ PerlIO *f); -PERL_EXPORT_C IV PerlIOBuf_flush(pTHX_ PerlIO *f); -PERL_EXPORT_C STDCHAR * PerlIOBuf_get_base(pTHX_ PerlIO *f); -PERL_EXPORT_C SSize_t PerlIOBuf_get_cnt(pTHX_ PerlIO *f); -PERL_EXPORT_C STDCHAR * PerlIOBuf_get_ptr(pTHX_ PerlIO *f); -PERL_EXPORT_C PerlIO * PerlIOBuf_open(pTHX_ PerlIO_funcs *self, PerlIO_list_t *layers, IV n, const char *mode, int fd, int imode, int perm, PerlIO *old, int narg, SV **args); -PERL_EXPORT_C IV PerlIOBuf_popped(pTHX_ PerlIO *f); -PERL_EXPORT_C IV PerlIOBuf_pushed(pTHX_ PerlIO *f, const char *mode, SV *arg, PerlIO_funcs *tab); -PERL_EXPORT_C SSize_t PerlIOBuf_read(pTHX_ PerlIO *f, void *vbuf, Size_t count); -PERL_EXPORT_C IV PerlIOBuf_seek(pTHX_ PerlIO *f, Off_t offset, int whence); -PERL_EXPORT_C void PerlIOBuf_set_ptrcnt(pTHX_ PerlIO *f, STDCHAR * ptr, SSize_t cnt); -PERL_EXPORT_C Off_t PerlIOBuf_tell(pTHX_ PerlIO *f); -PERL_EXPORT_C SSize_t PerlIOBuf_unread(pTHX_ PerlIO *f, const void *vbuf, Size_t count); -PERL_EXPORT_C SSize_t PerlIOBuf_write(pTHX_ PerlIO *f, const void *vbuf, Size_t count); +PERL_CALLCONV Size_t PerlIOBuf_bufsiz(pTHX_ PerlIO *f); +PERL_CALLCONV IV PerlIOBuf_close(pTHX_ PerlIO *f); +PERL_CALLCONV PerlIO * PerlIOBuf_dup(pTHX_ PerlIO *f, PerlIO *o, CLONE_PARAMS *param, int flags); +PERL_CALLCONV IV PerlIOBuf_fill(pTHX_ PerlIO *f); +PERL_CALLCONV IV PerlIOBuf_flush(pTHX_ PerlIO *f); +PERL_CALLCONV STDCHAR * PerlIOBuf_get_base(pTHX_ PerlIO *f); +PERL_CALLCONV SSize_t PerlIOBuf_get_cnt(pTHX_ PerlIO *f); +PERL_CALLCONV STDCHAR * PerlIOBuf_get_ptr(pTHX_ PerlIO *f); +PERL_CALLCONV PerlIO * PerlIOBuf_open(pTHX_ PerlIO_funcs *self, PerlIO_list_t *layers, IV n, const char *mode, int fd, int imode, int perm, PerlIO *old, int narg, SV **args); +PERL_CALLCONV IV PerlIOBuf_popped(pTHX_ PerlIO *f); +PERL_CALLCONV IV PerlIOBuf_pushed(pTHX_ PerlIO *f, const char *mode, SV *arg, PerlIO_funcs *tab); +PERL_CALLCONV SSize_t PerlIOBuf_read(pTHX_ PerlIO *f, void *vbuf, Size_t count); +PERL_CALLCONV IV PerlIOBuf_seek(pTHX_ PerlIO *f, Off_t offset, int whence); +PERL_CALLCONV void PerlIOBuf_set_ptrcnt(pTHX_ PerlIO *f, STDCHAR * ptr, SSize_t cnt); +PERL_CALLCONV Off_t PerlIOBuf_tell(pTHX_ PerlIO *f); +PERL_CALLCONV SSize_t PerlIOBuf_unread(pTHX_ PerlIO *f, const void *vbuf, Size_t count); +PERL_CALLCONV SSize_t PerlIOBuf_write(pTHX_ PerlIO *f, const void *vbuf, Size_t count); /* Crlf */ -PERL_EXPORT_C IV PerlIOCrlf_binmode(pTHX_ PerlIO *f); -PERL_EXPORT_C IV PerlIOCrlf_flush(pTHX_ PerlIO *f); -PERL_EXPORT_C SSize_t PerlIOCrlf_get_cnt(pTHX_ PerlIO *f); -PERL_EXPORT_C IV PerlIOCrlf_pushed(pTHX_ PerlIO *f, const char *mode, SV *arg, PerlIO_funcs *tab); -PERL_EXPORT_C void PerlIOCrlf_set_ptrcnt(pTHX_ PerlIO *f, STDCHAR * ptr, SSize_t cnt); -PERL_EXPORT_C SSize_t PerlIOCrlf_unread(pTHX_ PerlIO *f, const void *vbuf, Size_t count); -PERL_EXPORT_C SSize_t PerlIOCrlf_write(pTHX_ PerlIO *f, const void *vbuf, Size_t count); +PERL_CALLCONV IV PerlIOCrlf_binmode(pTHX_ PerlIO *f); +PERL_CALLCONV IV PerlIOCrlf_flush(pTHX_ PerlIO *f); +PERL_CALLCONV SSize_t PerlIOCrlf_get_cnt(pTHX_ PerlIO *f); +PERL_CALLCONV IV PerlIOCrlf_pushed(pTHX_ PerlIO *f, const char *mode, SV *arg, PerlIO_funcs *tab); +PERL_CALLCONV void PerlIOCrlf_set_ptrcnt(pTHX_ PerlIO *f, STDCHAR * ptr, SSize_t cnt); +PERL_CALLCONV SSize_t PerlIOCrlf_unread(pTHX_ PerlIO *f, const void *vbuf, Size_t count); +PERL_CALLCONV SSize_t PerlIOCrlf_write(pTHX_ PerlIO *f, const void *vbuf, Size_t count); /* Pending */ -PERL_EXPORT_C IV PerlIOPending_close(pTHX_ PerlIO *f); -PERL_EXPORT_C IV PerlIOPending_fill(pTHX_ PerlIO *f); -PERL_EXPORT_C IV PerlIOPending_flush(pTHX_ PerlIO *f); -PERL_EXPORT_C IV PerlIOPending_pushed(pTHX_ PerlIO *f, const char *mode, SV *arg, PerlIO_funcs *tab); -PERL_EXPORT_C SSize_t PerlIOPending_read(pTHX_ PerlIO *f, void *vbuf, Size_t count); -PERL_EXPORT_C IV PerlIOPending_seek(pTHX_ PerlIO *f, Off_t offset, int whence); -PERL_EXPORT_C void PerlIOPending_set_ptrcnt(pTHX_ PerlIO *f, STDCHAR * ptr, SSize_t cnt); +PERL_CALLCONV IV PerlIOPending_close(pTHX_ PerlIO *f); +PERL_CALLCONV IV PerlIOPending_fill(pTHX_ PerlIO *f); +PERL_CALLCONV IV PerlIOPending_flush(pTHX_ PerlIO *f); +PERL_CALLCONV IV PerlIOPending_pushed(pTHX_ PerlIO *f, const char *mode, SV *arg, PerlIO_funcs *tab); +PERL_CALLCONV SSize_t PerlIOPending_read(pTHX_ PerlIO *f, void *vbuf, Size_t count); +PERL_CALLCONV IV PerlIOPending_seek(pTHX_ PerlIO *f, Off_t offset, int whence); +PERL_CALLCONV void PerlIOPending_set_ptrcnt(pTHX_ PerlIO *f, STDCHAR * ptr, SSize_t cnt); /* Pop */ -PERL_EXPORT_C IV PerlIOPop_pushed(pTHX_ PerlIO *f, const char *mode, SV *arg, PerlIO_funcs *tab); +PERL_CALLCONV IV PerlIOPop_pushed(pTHX_ PerlIO *f, const char *mode, SV *arg, PerlIO_funcs *tab); /* Raw */ -PERL_EXPORT_C IV PerlIORaw_pushed(pTHX_ PerlIO *f, const char *mode, SV *arg, PerlIO_funcs *tab); +PERL_CALLCONV IV PerlIORaw_pushed(pTHX_ PerlIO *f, const char *mode, SV *arg, PerlIO_funcs *tab); /* Stdio */ -PERL_EXPORT_C void PerlIOStdio_clearerr(pTHX_ PerlIO *f); -PERL_EXPORT_C IV PerlIOStdio_close(pTHX_ PerlIO *f); -PERL_EXPORT_C PerlIO * PerlIOStdio_dup(pTHX_ PerlIO *f, PerlIO *o, CLONE_PARAMS *param, int flags); -PERL_EXPORT_C IV PerlIOStdio_eof(pTHX_ PerlIO *f); -PERL_EXPORT_C IV PerlIOStdio_error(pTHX_ PerlIO *f); -PERL_EXPORT_C IV PerlIOStdio_fileno(pTHX_ PerlIO *f); +PERL_CALLCONV void PerlIOStdio_clearerr(pTHX_ PerlIO *f); +PERL_CALLCONV IV PerlIOStdio_close(pTHX_ PerlIO *f); +PERL_CALLCONV PerlIO * PerlIOStdio_dup(pTHX_ PerlIO *f, PerlIO *o, CLONE_PARAMS *param, int flags); +PERL_CALLCONV IV PerlIOStdio_eof(pTHX_ PerlIO *f); +PERL_CALLCONV IV PerlIOStdio_error(pTHX_ PerlIO *f); +PERL_CALLCONV IV PerlIOStdio_fileno(pTHX_ PerlIO *f); #ifdef USE_STDIO_PTR -PERL_EXPORT_C STDCHAR * PerlIOStdio_get_ptr(pTHX_ PerlIO *f); -PERL_EXPORT_C SSize_t PerlIOStdio_get_cnt(pTHX_ PerlIO *f); -PERL_EXPORT_C void PerlIOStdio_set_ptrcnt(pTHX_ PerlIO *f, STDCHAR * ptr, SSize_t cnt); +PERL_CALLCONV STDCHAR * PerlIOStdio_get_ptr(pTHX_ PerlIO *f); +PERL_CALLCONV SSize_t PerlIOStdio_get_cnt(pTHX_ PerlIO *f); +PERL_CALLCONV void PerlIOStdio_set_ptrcnt(pTHX_ PerlIO *f, STDCHAR * ptr, SSize_t cnt); #endif -PERL_EXPORT_C IV PerlIOStdio_fill(pTHX_ PerlIO *f); -PERL_EXPORT_C IV PerlIOStdio_flush(pTHX_ PerlIO *f); +PERL_CALLCONV IV PerlIOStdio_fill(pTHX_ PerlIO *f); +PERL_CALLCONV IV PerlIOStdio_flush(pTHX_ PerlIO *f); #ifdef FILE_base -PERL_EXPORT_C STDCHAR * PerlIOStdio_get_base(pTHX_ PerlIO *f); -PERL_EXPORT_C Size_t PerlIOStdio_get_bufsiz(pTHX_ PerlIO *f); +PERL_CALLCONV STDCHAR * PerlIOStdio_get_base(pTHX_ PerlIO *f); +PERL_CALLCONV Size_t PerlIOStdio_get_bufsiz(pTHX_ PerlIO *f); #endif -PERL_EXPORT_C char * PerlIOStdio_mode(const char *mode, char *tmode); -PERL_EXPORT_C PerlIO * PerlIOStdio_open(pTHX_ PerlIO_funcs *self, PerlIO_list_t *layers, IV n, const char *mode, int fd, int imode, int perm, PerlIO *f, int narg, SV **args); -PERL_EXPORT_C IV PerlIOStdio_pushed(pTHX_ PerlIO *f, const char *mode, SV *arg, PerlIO_funcs *tab); -PERL_EXPORT_C SSize_t PerlIOStdio_read(pTHX_ PerlIO *f, void *vbuf, Size_t count); -PERL_EXPORT_C IV PerlIOStdio_seek(pTHX_ PerlIO *f, Off_t offset, int whence); -PERL_EXPORT_C void PerlIOStdio_setlinebuf(pTHX_ PerlIO *f); -PERL_EXPORT_C Off_t PerlIOStdio_tell(pTHX_ PerlIO *f); -PERL_EXPORT_C SSize_t PerlIOStdio_unread(pTHX_ PerlIO *f, const void *vbuf, Size_t count); -PERL_EXPORT_C SSize_t PerlIOStdio_write(pTHX_ PerlIO *f, const void *vbuf, Size_t count); +PERL_CALLCONV char * PerlIOStdio_mode(const char *mode, char *tmode); +PERL_CALLCONV PerlIO * PerlIOStdio_open(pTHX_ PerlIO_funcs *self, PerlIO_list_t *layers, IV n, const char *mode, int fd, int imode, int perm, PerlIO *f, int narg, SV **args); +PERL_CALLCONV IV PerlIOStdio_pushed(pTHX_ PerlIO *f, const char *mode, SV *arg, PerlIO_funcs *tab); +PERL_CALLCONV SSize_t PerlIOStdio_read(pTHX_ PerlIO *f, void *vbuf, Size_t count); +PERL_CALLCONV IV PerlIOStdio_seek(pTHX_ PerlIO *f, Off_t offset, int whence); +PERL_CALLCONV void PerlIOStdio_setlinebuf(pTHX_ PerlIO *f); +PERL_CALLCONV Off_t PerlIOStdio_tell(pTHX_ PerlIO *f); +PERL_CALLCONV SSize_t PerlIOStdio_unread(pTHX_ PerlIO *f, const void *vbuf, Size_t count); +PERL_CALLCONV SSize_t PerlIOStdio_write(pTHX_ PerlIO *f, const void *vbuf, Size_t count); /* Unix */ -PERL_EXPORT_C IV PerlIOUnix_close(pTHX_ PerlIO *f); -PERL_EXPORT_C PerlIO * PerlIOUnix_dup(pTHX_ PerlIO *f, PerlIO *o, CLONE_PARAMS *param, int flags); -PERL_EXPORT_C IV PerlIOUnix_fileno(pTHX_ PerlIO *f); -PERL_EXPORT_C int PerlIOUnix_oflags(const char *mode); -PERL_EXPORT_C PerlIO * PerlIOUnix_open(pTHX_ PerlIO_funcs *self, PerlIO_list_t *layers, IV n, const char *mode, int fd, int imode, int perm, PerlIO *f, int narg, SV **args); -PERL_EXPORT_C IV PerlIOUnix_pushed(pTHX_ PerlIO *f, const char *mode, SV *arg, PerlIO_funcs *tab); -PERL_EXPORT_C SSize_t PerlIOUnix_read(pTHX_ PerlIO *f, void *vbuf, Size_t count); -PERL_EXPORT_C int PerlIOUnix_refcnt_dec(int fd); -PERL_EXPORT_C void PerlIOUnix_refcnt_inc(int fd); -PERL_EXPORT_C int PerlIOUnix_refcnt(int fd); -PERL_EXPORT_C IV PerlIOUnix_seek(pTHX_ PerlIO *f, Off_t offset, int whence); -PERL_EXPORT_C Off_t PerlIOUnix_tell(pTHX_ PerlIO *f); -PERL_EXPORT_C SSize_t PerlIOUnix_write(pTHX_ PerlIO *f, const void *vbuf, Size_t count); +PERL_CALLCONV IV PerlIOUnix_close(pTHX_ PerlIO *f); +PERL_CALLCONV PerlIO * PerlIOUnix_dup(pTHX_ PerlIO *f, PerlIO *o, CLONE_PARAMS *param, int flags); +PERL_CALLCONV IV PerlIOUnix_fileno(pTHX_ PerlIO *f); +PERL_CALLCONV int PerlIOUnix_oflags(const char *mode); +PERL_CALLCONV PerlIO * PerlIOUnix_open(pTHX_ PerlIO_funcs *self, PerlIO_list_t *layers, IV n, const char *mode, int fd, int imode, int perm, PerlIO *f, int narg, SV **args); +PERL_CALLCONV IV PerlIOUnix_pushed(pTHX_ PerlIO *f, const char *mode, SV *arg, PerlIO_funcs *tab); +PERL_CALLCONV SSize_t PerlIOUnix_read(pTHX_ PerlIO *f, void *vbuf, Size_t count); +PERL_CALLCONV int PerlIOUnix_refcnt_dec(int fd); +PERL_CALLCONV void PerlIOUnix_refcnt_inc(int fd); +PERL_CALLCONV int PerlIOUnix_refcnt(int fd); +PERL_CALLCONV IV PerlIOUnix_seek(pTHX_ PerlIO *f, Off_t offset, int whence); +PERL_CALLCONV Off_t PerlIOUnix_tell(pTHX_ PerlIO *f); +PERL_CALLCONV SSize_t PerlIOUnix_write(pTHX_ PerlIO *f, const void *vbuf, Size_t count); /* Utf8 */ -PERL_EXPORT_C IV PerlIOUtf8_pushed(pTHX_ PerlIO *f, const char *mode, SV *arg, PerlIO_funcs *tab); +PERL_CALLCONV IV PerlIOUtf8_pushed(pTHX_ PerlIO *f, const char *mode, SV *arg, PerlIO_funcs *tab); #endif /* _PERLIOL_H */ diff --git a/regexp.h b/regexp.h index 04eeba9..4e94213 100644 --- a/regexp.h +++ b/regexp.h @@ -168,7 +168,7 @@ typedef struct regexp_engine { const U32 flags, re_scream_pos_data *data); SV* (*checkstr) (pTHX_ REGEXP * const rx); - void (*free) (pTHX_ REGEXP * const rx); + void (*rxfree) (pTHX_ REGEXP * const rx); void (*numbered_buff_FETCH) (pTHX_ REGEXP * const rx, const I32 paren, SV * const sv); void (*numbered_buff_STORE) (pTHX_ REGEXP * const rx, const I32 paren, diff --git a/symbian/symbianish.h b/symbian/symbianish.h index a76a755..da5332c 100644 --- a/symbian/symbianish.h +++ b/symbian/symbianish.h @@ -142,11 +142,7 @@ pid_t wait(int *status); # define PERL_UNSET_VARS(v) symbian_unset_vars() #endif /* #ifdef PERL_GLOBAL_STRUCT_PRIVATE */ -#undef PERL_EXPORT_C -#define PERL_EXPORT_C EXPORT_C /* for perlio.h */ #define PERL_CALLCONV EXPORT_C /* for proto.h */ -#undef PERL_XS_EXPORT_C -#define PERL_XS_EXPORT_C EXPORT_C #ifndef PERL_CORE #define PERL_CORE /* for WINS builds under VC */ diff --git a/win32/win32.h b/win32/win32.h index 8a55202..bb155ed 100644 --- a/win32/win32.h +++ b/win32/win32.h @@ -634,14 +634,6 @@ EXTERN_C _CRTIMP ioinfo* __pioinfo[]; #endif #define PERLIO_NOT_STDIO 0 -#include "perlio.h" - -/* - * This provides a layer of functions and macros to ensure extensions will - * get to use the same RTL functions as the core. - */ -#include "win32iop.h" - #define EXEC_ARGV_CAST(x) ((const char *const *) x) DllExport void *win32_signal_context(void); -- 1.7.9.msysgit.0 ```
p5pRT commented 9 years ago

From @tonycoz

On Sun May 10 13​:50​:00 2015\, bulk88 wrote​:

For 5.23. See attached patch.

Presumably an edit glitch in the patch comment​:

  I this in observed in XS-Typemap's DLL.

This looks like an unrelated change​:

#define CALLREGFREE_PVT(prog) \ - if(prog) RX_ENGINE(prog)->free(aTHX_ (prog)) + if(prog) RX_ENGINE(prog)->rxfree(aTHX_ (prog))

It doesn't really need a new name\, it could be just​:

#define CALLREGFREE_PVT(prog) \ - if(prog) RX_ENGINE(prog)->free(aTHX_ (prog)) + if(prog) (RX_ENGINE(prog)->free)(aTHX_ (prog))

but should be separate anyway.

Tony

p5pRT commented 9 years ago

The RT System itself - Status changed from 'new' to 'open'

p5pRT commented 9 years ago

From @bulk88

On Sun May 10 18​:12​:50 2015\, tonyc wrote​:

On Sun May 10 13​:50​:00 2015\, bulk88 wrote​:

For 5.23. See attached patch.

Presumably an edit glitch in the patch comment​:

I this in observed in XS-Typemap's DLL.

fixed in attached patch

This looks like an unrelated change​:

#define CALLREGFREE_PVT(prog) \ - if(prog) RX_ENGINE(prog)->free(aTHX_ (prog)) + if(prog) RX_ENGINE(prog)->rxfree(aTHX_ (prog))

It doesn't really need a new name\, it could be just​:

#define CALLREGFREE_PVT(prog) \ - if(prog) RX_ENGINE(prog)->free(aTHX_ (prog)) + if(prog) (RX_ENGINE(prog)->free)(aTHX_ (prog))

but should be separate anyway.

Tony

doesn't work


cl -c -nologo -GF -W3 -I..\lib\CORE -I.\include -I. -I.. -DWIN32 -D_CONSOLE -DNO _STRICT -DPERLDLL -DPERL_CORE -O1 -MD -Zi -DNDEBUG -GL -DPERL_EXTERN AL_GLOB -DPERL_IS_MINIPERL -Fomini\regcomp.obj -Fdmini\regcomp.pdb ..\regcomp.c regcomp.c ..\regcomp.c(17210) : error C2039​: 'win32_free' : is not a member of 'regexp_eng ine'   c​:\perl521\srcnewb4opt\regexp.h(157) : see declaration of 'regexp_engine ' b88dmake​: Error code 130\, while making 'mini\regcomp.obj'


the define in win32iop.h is

#define free win32_free

not "#define free(a) win32_free(a)"

-- bulk88 ~ bulk88 at hotmail.com

p5pRT commented 9 years ago

From @bulk88

0001-remove-redundant-PERL_EXPORT_C-and-PERL_XS_EXPORT_C-.patch ```diff From b1c7eeaa7c07cd98521cb1cf9940d8dc872be3e5 Mon Sep 17 00:00:00 2001 From: Daniel Dragan Date: Sun, 10 May 2015 23:30:21 -0400 Subject: [PATCH] remove redundant PERL_EXPORT_C and PERL_XS_EXPORT_C macros These 2 macros were created for the Symbian port in commit "Symbian port of Perl" to replace a direct "extern" token. I guess the author was unaware of PERL_CALLCONV. PERL_CALLCONV is the official macro to use. PERL_XS_EXPORT_C and PERL_EXPORT_C have no usage on cpan grep except for modules with direct copies of core headers. A defect of using PERL_EXPORT_C and PERL_XS_EXPORT_C instead of PERL_CALLCONV is that win32/win32.h has no knowledge of the 2 macros and doesn't set them, and os/os2ish.h doesn't either. On Win32, since the unix defaults are used instead of Win32 specific "__declspec(dllimport)" token, XS modules use indirect function stubs in each XS module placed by the CC to call into perl5**.dll instead of directly calls the core C functions. I observed this in in XS-Typemap's DLL. To simplify the API, and to decrease the amount of macros needing to implemented to support each platform, just remove the 2 macros. Since perl.h's fallback defaults for PERL_CALLCONV are very late in perl.h, they need to be moved up before function declarations start in perlio.h (perlio.h is included from iperlsys.h). win32iop.h contains the "PerlIO" and SV" tokens, so perlio.h must be included before win32iop.h is. Including perlio.h so early in win32.h, causes PERL_CALLCONV not be defined since Win32 platform uses the fallback in perl.h, since win32.h doesn't always define PERL_CALLCONV and sometimes relies on the fallback. Since win32iop.h contains alot of declarations, it belongs with other declarations such as those in proto.h so move it from win32.h to perl.h. the "free" token in struct regexp_engine conflicts with win32iop's "#define free win32_free" so rename that member. --- handy.h | 6 +- perl.h | 79 ++++++++----------- perlio.h | 114 ++++++++++++++-------------- perliol.h | 210 +++++++++++++++++++++++++------------------------- regexp.h | 2 +- symbian/symbianish.h | 4 - win32/win32.h | 8 -- 7 files changed, 199 insertions(+), 224 deletions(-) diff --git a/handy.h b/handy.h index 89055c5..7151072 100644 --- a/handy.h +++ b/handy.h @@ -1966,11 +1966,11 @@ PoisonWith(0xEF) for catching access to freed memory. * - lots of ENV reads */ -PERL_EXPORT_C Malloc_t Perl_mem_log_alloc(const UV n, const UV typesize, const char *type_name, Malloc_t newalloc, const char *filename, const int linenumber, const char *funcname); +PERL_CALLCONV Malloc_t Perl_mem_log_alloc(const UV n, const UV typesize, const char *type_name, Malloc_t newalloc, const char *filename, const int linenumber, const char *funcname); -PERL_EXPORT_C Malloc_t Perl_mem_log_realloc(const UV n, const UV typesize, const char *type_name, Malloc_t oldalloc, Malloc_t newalloc, const char *filename, const int linenumber, const char *funcname); +PERL_CALLCONV Malloc_t Perl_mem_log_realloc(const UV n, const UV typesize, const char *type_name, Malloc_t oldalloc, Malloc_t newalloc, const char *filename, const int linenumber, const char *funcname); -PERL_EXPORT_C Malloc_t Perl_mem_log_free(Malloc_t oldalloc, const char *filename, const int linenumber, const char *funcname); +PERL_CALLCONV Malloc_t Perl_mem_log_free(Malloc_t oldalloc, const char *filename, const int linenumber, const char *funcname); # ifdef PERL_CORE # ifndef PERL_MEM_LOG_NOIMPL diff --git a/perl.h b/perl.h index dcb184b..63bb377 100644 --- a/perl.h +++ b/perl.h @@ -231,7 +231,7 @@ Perl_pregfree(aTHX_ (prog)) #define CALLREGFREE_PVT(prog) \ - if(prog) RX_ENGINE(prog)->free(aTHX_ (prog)) + if(prog) RX_ENGINE(prog)->rxfree(aTHX_ (prog)) #define CALLREG_NUMBUF_FETCH(rx,paren,usesv) \ RX_ENGINE(rx)->numbered_buff_FETCH(aTHX_ (rx),(paren),(usesv)) @@ -496,26 +496,6 @@ # endif #endif -/* Some platforms require marking function declarations - * for them to be exportable. Used in perlio.h, proto.h - * is handled either by the makedef.pl or by defining the - * PERL_CALLCONV to be something special. See also the - * definition of XS() in XSUB.h. */ -#ifndef PERL_EXPORT_C -# ifdef __cplusplus -# define PERL_EXPORT_C extern "C" -# else -# define PERL_EXPORT_C extern -# endif -#endif -#ifndef PERL_XS_EXPORT_C -# ifdef __cplusplus -# define PERL_XS_EXPORT_C extern "C" -# else -# define PERL_XS_EXPORT_C -# endif -#endif - #if defined(__GNUC__) && !defined(PERL_GCC_BRACE_GROUPS_FORBIDDEN) && !defined(__cplusplus) # ifndef PERL_USE_GCC_BRACE_GROUPS # define PERL_USE_GCC_BRACE_GROUPS @@ -3684,6 +3664,30 @@ typedef struct crypt_data { /* straight from /usr/include/crypt.h */ #endif /* threading */ #endif /* AIX */ +#ifndef PERL_CALLCONV +# ifdef __cplusplus +# define PERL_CALLCONV extern "C" +# else +# define PERL_CALLCONV +# endif +#endif +#ifndef PERL_CALLCONV_NO_RET +# define PERL_CALLCONV_NO_RET PERL_CALLCONV +#endif + +/* PERL_STATIC_NO_RET is supposed to be equivalent to STATIC on builds that + dont have a noreturn as a declaration specifier +*/ +#ifndef PERL_STATIC_NO_RET +# define PERL_STATIC_NO_RET STATIC +#endif +/* PERL_STATIC_NO_RET is supposed to be equivalent to PERL_STATIC_INLINE on + builds that dont have a noreturn as a declaration specifier +*/ +#ifndef PERL_STATIC_INLINE_NO_RET +# define PERL_STATIC_INLINE_NO_RET PERL_STATIC_INLINE +#endif + #if !defined(OS2) # include "iperlsys.h" #endif @@ -5469,31 +5473,6 @@ struct tempsym; /* defined in pp_pack.c */ #include "thread.h" #include "pp.h" -#ifndef PERL_CALLCONV -# ifdef __cplusplus -# define PERL_CALLCONV extern "C" -# else -# define PERL_CALLCONV -# endif -#endif -#ifndef PERL_CALLCONV_NO_RET -# define PERL_CALLCONV_NO_RET PERL_CALLCONV -#endif - -/* PERL_STATIC_NO_RET is supposed to be equivalent to STATIC on builds that - dont have a noreturn as a declaration specifier -*/ -#ifndef PERL_STATIC_NO_RET -# define PERL_STATIC_NO_RET STATIC -#endif -/* PERL_STATIC_NO_RET is supposed to be equivalent to PERL_STATIC_INLINE on - builds that dont have a noreturn as a declaration specifier -*/ -#ifndef PERL_STATIC_INLINE_NO_RET -# define PERL_STATIC_INLINE_NO_RET PERL_STATIC_INLINE -#endif - - #undef PERL_CKDEF #undef PERL_PPDEF #define PERL_CKDEF(s) PERL_CALLCONV OP *s (pTHX_ OP *o); @@ -5503,6 +5482,14 @@ struct tempsym; /* defined in pp_pack.c */ # include "malloc_ctl.h" #endif +/* + * This provides a layer of functions and macros to ensure extensions will + * get to use the same RTL functions as the core. + */ +#if defined(WIN32) +# include "win32iop.h" +#endif + #include "proto.h" /* this has structure inits, so it cannot be included before here */ diff --git a/perlio.h b/perlio.h index 55e0ce3..8e700fe 100644 --- a/perlio.h +++ b/perlio.h @@ -96,15 +96,15 @@ typedef PerlIOl *PerlIO; #define PERLIO_FUNCS_CAST(funcs) (funcs) #endif -PERL_EXPORT_C void PerlIO_define_layer(pTHX_ PerlIO_funcs *tab); -PERL_EXPORT_C PerlIO_funcs *PerlIO_find_layer(pTHX_ const char *name, +PERL_CALLCONV void PerlIO_define_layer(pTHX_ PerlIO_funcs *tab); +PERL_CALLCONV PerlIO_funcs *PerlIO_find_layer(pTHX_ const char *name, STRLEN len, int load); -PERL_EXPORT_C PerlIO *PerlIO_push(pTHX_ PerlIO *f, PERLIO_FUNCS_DECL(*tab), +PERL_CALLCONV PerlIO *PerlIO_push(pTHX_ PerlIO *f, PERLIO_FUNCS_DECL(*tab), const char *mode, SV *arg); -PERL_EXPORT_C void PerlIO_pop(pTHX_ PerlIO *f); -PERL_EXPORT_C AV* PerlIO_get_layers(pTHX_ PerlIO *f); -PERL_EXPORT_C void PerlIO_clone(pTHX_ PerlInterpreter *proto, +PERL_CALLCONV void PerlIO_pop(pTHX_ PerlIO *f); +PERL_CALLCONV AV* PerlIO_get_layers(pTHX_ PerlIO *f); +PERL_CALLCONV void PerlIO_clone(pTHX_ PerlInterpreter *proto, CLONE_PARAMS *param); #endif /* PerlIO */ @@ -202,161 +202,161 @@ START_EXTERN_C # endif #endif #ifndef PerlIO_init -PERL_EXPORT_C void PerlIO_init(pTHX); +PERL_CALLCONV void PerlIO_init(pTHX); #endif #ifndef PerlIO_stdoutf -PERL_EXPORT_C int PerlIO_stdoutf(const char *, ...) +PERL_CALLCONV int PerlIO_stdoutf(const char *, ...) __attribute__format__(__printf__, 1, 2); #endif #ifndef PerlIO_puts -PERL_EXPORT_C int PerlIO_puts(PerlIO *, const char *); +PERL_CALLCONV int PerlIO_puts(PerlIO *, const char *); #endif #ifndef PerlIO_open -PERL_EXPORT_C PerlIO *PerlIO_open(const char *, const char *); +PERL_CALLCONV PerlIO *PerlIO_open(const char *, const char *); #endif #ifndef PerlIO_openn -PERL_EXPORT_C PerlIO *PerlIO_openn(pTHX_ const char *layers, const char *mode, +PERL_CALLCONV PerlIO *PerlIO_openn(pTHX_ const char *layers, const char *mode, int fd, int imode, int perm, PerlIO *old, int narg, SV **arg); #endif #ifndef PerlIO_eof -PERL_EXPORT_C int PerlIO_eof(PerlIO *); +PERL_CALLCONV int PerlIO_eof(PerlIO *); #endif #ifndef PerlIO_error -PERL_EXPORT_C int PerlIO_error(PerlIO *); +PERL_CALLCONV int PerlIO_error(PerlIO *); #endif #ifndef PerlIO_clearerr -PERL_EXPORT_C void PerlIO_clearerr(PerlIO *); +PERL_CALLCONV void PerlIO_clearerr(PerlIO *); #endif #ifndef PerlIO_getc -PERL_EXPORT_C int PerlIO_getc(PerlIO *); +PERL_CALLCONV int PerlIO_getc(PerlIO *); #endif #ifndef PerlIO_putc -PERL_EXPORT_C int PerlIO_putc(PerlIO *, int); +PERL_CALLCONV int PerlIO_putc(PerlIO *, int); #endif #ifndef PerlIO_ungetc -PERL_EXPORT_C int PerlIO_ungetc(PerlIO *, int); +PERL_CALLCONV int PerlIO_ungetc(PerlIO *, int); #endif #ifndef PerlIO_fdopen -PERL_EXPORT_C PerlIO *PerlIO_fdopen(int, const char *); +PERL_CALLCONV PerlIO *PerlIO_fdopen(int, const char *); #endif #ifndef PerlIO_importFILE -PERL_EXPORT_C PerlIO *PerlIO_importFILE(FILE *, const char *); +PERL_CALLCONV PerlIO *PerlIO_importFILE(FILE *, const char *); #endif #ifndef PerlIO_exportFILE -PERL_EXPORT_C FILE *PerlIO_exportFILE(PerlIO *, const char *); +PERL_CALLCONV FILE *PerlIO_exportFILE(PerlIO *, const char *); #endif #ifndef PerlIO_findFILE -PERL_EXPORT_C FILE *PerlIO_findFILE(PerlIO *); +PERL_CALLCONV FILE *PerlIO_findFILE(PerlIO *); #endif #ifndef PerlIO_releaseFILE -PERL_EXPORT_C void PerlIO_releaseFILE(PerlIO *, FILE *); +PERL_CALLCONV void PerlIO_releaseFILE(PerlIO *, FILE *); #endif #ifndef PerlIO_read -PERL_EXPORT_C SSize_t PerlIO_read(PerlIO *, void *, Size_t); +PERL_CALLCONV SSize_t PerlIO_read(PerlIO *, void *, Size_t); #endif #ifndef PerlIO_unread -PERL_EXPORT_C SSize_t PerlIO_unread(PerlIO *, const void *, Size_t); +PERL_CALLCONV SSize_t PerlIO_unread(PerlIO *, const void *, Size_t); #endif #ifndef PerlIO_write -PERL_EXPORT_C SSize_t PerlIO_write(PerlIO *, const void *, Size_t); +PERL_CALLCONV SSize_t PerlIO_write(PerlIO *, const void *, Size_t); #endif #ifndef PerlIO_setlinebuf -PERL_EXPORT_C void PerlIO_setlinebuf(PerlIO *); +PERL_CALLCONV void PerlIO_setlinebuf(PerlIO *); #endif #ifndef PerlIO_printf -PERL_EXPORT_C int PerlIO_printf(PerlIO *, const char *, ...) +PERL_CALLCONV int PerlIO_printf(PerlIO *, const char *, ...) __attribute__format__(__printf__, 2, 3); #endif #ifndef PerlIO_vprintf -PERL_EXPORT_C int PerlIO_vprintf(PerlIO *, const char *, va_list); +PERL_CALLCONV int PerlIO_vprintf(PerlIO *, const char *, va_list); #endif #ifndef PerlIO_tell -PERL_EXPORT_C Off_t PerlIO_tell(PerlIO *); +PERL_CALLCONV Off_t PerlIO_tell(PerlIO *); #endif #ifndef PerlIO_seek -PERL_EXPORT_C int PerlIO_seek(PerlIO *, Off_t, int); +PERL_CALLCONV int PerlIO_seek(PerlIO *, Off_t, int); #endif #ifndef PerlIO_rewind -PERL_EXPORT_C void PerlIO_rewind(PerlIO *); +PERL_CALLCONV void PerlIO_rewind(PerlIO *); #endif #ifndef PerlIO_has_base -PERL_EXPORT_C int PerlIO_has_base(PerlIO *); +PERL_CALLCONV int PerlIO_has_base(PerlIO *); #endif #ifndef PerlIO_has_cntptr -PERL_EXPORT_C int PerlIO_has_cntptr(PerlIO *); +PERL_CALLCONV int PerlIO_has_cntptr(PerlIO *); #endif #ifndef PerlIO_fast_gets -PERL_EXPORT_C int PerlIO_fast_gets(PerlIO *); +PERL_CALLCONV int PerlIO_fast_gets(PerlIO *); #endif #ifndef PerlIO_canset_cnt -PERL_EXPORT_C int PerlIO_canset_cnt(PerlIO *); +PERL_CALLCONV int PerlIO_canset_cnt(PerlIO *); #endif #ifndef PerlIO_get_ptr -PERL_EXPORT_C STDCHAR *PerlIO_get_ptr(PerlIO *); +PERL_CALLCONV STDCHAR *PerlIO_get_ptr(PerlIO *); #endif #ifndef PerlIO_get_cnt -PERL_EXPORT_C SSize_t PerlIO_get_cnt(PerlIO *); +PERL_CALLCONV SSize_t PerlIO_get_cnt(PerlIO *); #endif #ifndef PerlIO_set_cnt -PERL_EXPORT_C void PerlIO_set_cnt(PerlIO *, SSize_t); +PERL_CALLCONV void PerlIO_set_cnt(PerlIO *, SSize_t); #endif #ifndef PerlIO_set_ptrcnt -PERL_EXPORT_C void PerlIO_set_ptrcnt(PerlIO *, STDCHAR *, SSize_t); +PERL_CALLCONV void PerlIO_set_ptrcnt(PerlIO *, STDCHAR *, SSize_t); #endif #ifndef PerlIO_get_base -PERL_EXPORT_C STDCHAR *PerlIO_get_base(PerlIO *); +PERL_CALLCONV STDCHAR *PerlIO_get_base(PerlIO *); #endif #ifndef PerlIO_get_bufsiz -PERL_EXPORT_C SSize_t PerlIO_get_bufsiz(PerlIO *); +PERL_CALLCONV SSize_t PerlIO_get_bufsiz(PerlIO *); #endif #ifndef PerlIO_tmpfile -PERL_EXPORT_C PerlIO *PerlIO_tmpfile(void); +PERL_CALLCONV PerlIO *PerlIO_tmpfile(void); #endif #ifndef PerlIO_stdin -PERL_EXPORT_C PerlIO *PerlIO_stdin(void); +PERL_CALLCONV PerlIO *PerlIO_stdin(void); #endif #ifndef PerlIO_stdout -PERL_EXPORT_C PerlIO *PerlIO_stdout(void); +PERL_CALLCONV PerlIO *PerlIO_stdout(void); #endif #ifndef PerlIO_stderr -PERL_EXPORT_C PerlIO *PerlIO_stderr(void); +PERL_CALLCONV PerlIO *PerlIO_stderr(void); #endif #ifndef PerlIO_getpos -PERL_EXPORT_C int PerlIO_getpos(PerlIO *, SV *); +PERL_CALLCONV int PerlIO_getpos(PerlIO *, SV *); #endif #ifndef PerlIO_setpos -PERL_EXPORT_C int PerlIO_setpos(PerlIO *, SV *); +PERL_CALLCONV int PerlIO_setpos(PerlIO *, SV *); #endif #ifndef PerlIO_fdupopen -PERL_EXPORT_C PerlIO *PerlIO_fdupopen(pTHX_ PerlIO *, CLONE_PARAMS *, int); +PERL_CALLCONV PerlIO *PerlIO_fdupopen(pTHX_ PerlIO *, CLONE_PARAMS *, int); #endif #if !defined(PerlIO_modestr) && !defined(PERLIO_IS_STDIO) -PERL_EXPORT_C char *PerlIO_modestr(PerlIO *, char *buf); +PERL_CALLCONV char *PerlIO_modestr(PerlIO *, char *buf); #endif #ifndef PerlIO_isutf8 -PERL_EXPORT_C int PerlIO_isutf8(PerlIO *); +PERL_CALLCONV int PerlIO_isutf8(PerlIO *); #endif #ifndef PerlIO_apply_layers -PERL_EXPORT_C int PerlIO_apply_layers(pTHX_ PerlIO *f, const char *mode, +PERL_CALLCONV int PerlIO_apply_layers(pTHX_ PerlIO *f, const char *mode, const char *names); #endif #ifndef PerlIO_binmode -PERL_EXPORT_C int PerlIO_binmode(pTHX_ PerlIO *f, int iotype, int omode, +PERL_CALLCONV int PerlIO_binmode(pTHX_ PerlIO *f, int iotype, int omode, const char *names); #endif #ifndef PerlIO_getname -PERL_EXPORT_C char *PerlIO_getname(PerlIO *, char *); +PERL_CALLCONV char *PerlIO_getname(PerlIO *, char *); #endif -PERL_EXPORT_C void PerlIO_destruct(pTHX); +PERL_CALLCONV void PerlIO_destruct(pTHX); -PERL_EXPORT_C int PerlIO_intmode2str(int rawmode, char *mode, int *writing); +PERL_CALLCONV int PerlIO_intmode2str(int rawmode, char *mode, int *writing); #ifdef PERLIO_LAYERS -PERL_EXPORT_C void PerlIO_cleanup(pTHX); +PERL_CALLCONV void PerlIO_cleanup(pTHX); -PERL_EXPORT_C void PerlIO_debug(const char *fmt, ...) +PERL_CALLCONV void PerlIO_debug(const char *fmt, ...) __attribute__format__(__printf__, 1, 2); typedef struct PerlIO_list_s PerlIO_list_t; diff --git a/perliol.h b/perliol.h index b8c0eae..d15c937 100644 --- a/perliol.h +++ b/perliol.h @@ -124,8 +124,8 @@ EXTPERLIO PerlIO_funcs PerlIO_pending; #ifdef WIN32 EXTPERLIO PerlIO_funcs PerlIO_win32; #endif -PERL_EXPORT_C PerlIO *PerlIO_allocate(pTHX); -PERL_EXPORT_C SV *PerlIO_arg_fetch(PerlIO_list_t *av, IV n); +PERL_CALLCONV PerlIO *PerlIO_allocate(pTHX); +PERL_CALLCONV SV *PerlIO_arg_fetch(PerlIO_list_t *av, IV n); #define PerlIOArg PerlIO_arg_fetch(layers,n) #ifdef PERLIO_USING_CRLF @@ -150,28 +150,28 @@ typedef struct { IV oneword; /* Emergency buffer */ } PerlIOBuf; -PERL_EXPORT_C int PerlIO_apply_layera(pTHX_ PerlIO *f, const char *mode, +PERL_CALLCONV int PerlIO_apply_layera(pTHX_ PerlIO *f, const char *mode, PerlIO_list_t *layers, IV n, IV max); -PERL_EXPORT_C int PerlIO_parse_layers(pTHX_ PerlIO_list_t *av, const char *names); -PERL_EXPORT_C PerlIO_funcs *PerlIO_layer_fetch(pTHX_ PerlIO_list_t *av, IV n, PerlIO_funcs *def); +PERL_CALLCONV int PerlIO_parse_layers(pTHX_ PerlIO_list_t *av, const char *names); +PERL_CALLCONV PerlIO_funcs *PerlIO_layer_fetch(pTHX_ PerlIO_list_t *av, IV n, PerlIO_funcs *def); -PERL_EXPORT_C SV *PerlIO_sv_dup(pTHX_ SV *arg, CLONE_PARAMS *param); -PERL_EXPORT_C void PerlIO_cleantable(pTHX_ PerlIOl **tablep); -PERL_EXPORT_C SV * PerlIO_tab_sv(pTHX_ PerlIO_funcs *tab); -PERL_EXPORT_C void PerlIO_default_buffer(pTHX_ PerlIO_list_t *av); -PERL_EXPORT_C void PerlIO_stdstreams(pTHX); -PERL_EXPORT_C int PerlIO__close(pTHX_ PerlIO *f); -PERL_EXPORT_C PerlIO_list_t * PerlIO_resolve_layers(pTHX_ const char *layers, const char *mode, int narg, SV **args); -PERL_EXPORT_C PerlIO_funcs * PerlIO_default_layer(pTHX_ I32 n); -PERL_EXPORT_C PerlIO_list_t * PerlIO_default_layers(pTHX); -PERL_EXPORT_C PerlIO * PerlIO_reopen(const char *path, const char *mode, PerlIO *f); +PERL_CALLCONV SV *PerlIO_sv_dup(pTHX_ SV *arg, CLONE_PARAMS *param); +PERL_CALLCONV void PerlIO_cleantable(pTHX_ PerlIOl **tablep); +PERL_CALLCONV SV * PerlIO_tab_sv(pTHX_ PerlIO_funcs *tab); +PERL_CALLCONV void PerlIO_default_buffer(pTHX_ PerlIO_list_t *av); +PERL_CALLCONV void PerlIO_stdstreams(pTHX); +PERL_CALLCONV int PerlIO__close(pTHX_ PerlIO *f); +PERL_CALLCONV PerlIO_list_t * PerlIO_resolve_layers(pTHX_ const char *layers, const char *mode, int narg, SV **args); +PERL_CALLCONV PerlIO_funcs * PerlIO_default_layer(pTHX_ I32 n); +PERL_CALLCONV PerlIO_list_t * PerlIO_default_layers(pTHX); +PERL_CALLCONV PerlIO * PerlIO_reopen(const char *path, const char *mode, PerlIO *f); -PERL_EXPORT_C PerlIO_list_t *PerlIO_list_alloc(pTHX); -PERL_EXPORT_C PerlIO_list_t *PerlIO_clone_list(pTHX_ PerlIO_list_t *proto, CLONE_PARAMS *param); -PERL_EXPORT_C void PerlIO_list_free(pTHX_ PerlIO_list_t *list); -PERL_EXPORT_C void PerlIO_list_push(pTHX_ PerlIO_list_t *list, PerlIO_funcs *funcs, SV *arg); -PERL_EXPORT_C void PerlIO_list_free(pTHX_ PerlIO_list_t *list); +PERL_CALLCONV PerlIO_list_t *PerlIO_list_alloc(pTHX); +PERL_CALLCONV PerlIO_list_t *PerlIO_clone_list(pTHX_ PerlIO_list_t *proto, CLONE_PARAMS *param); +PERL_CALLCONV void PerlIO_list_free(pTHX_ PerlIO_list_t *list); +PERL_CALLCONV void PerlIO_list_push(pTHX_ PerlIO_list_t *list, PerlIO_funcs *funcs, SV *arg); +PERL_CALLCONV void PerlIO_list_free(pTHX_ PerlIO_list_t *list); /* PerlIO_teardown doesn't need exporting, but the EXTERN_C is needed * for compiling as C++. Must also match with what perl.h says. */ @@ -180,111 +180,111 @@ EXTERN_C void PerlIO_teardown(void); /*--------------------------------------------------------------------------------------*/ /* Generic, or stub layer functions */ -PERL_EXPORT_C IV PerlIOBase_binmode(pTHX_ PerlIO *f); -PERL_EXPORT_C void PerlIOBase_clearerr(pTHX_ PerlIO *f); -PERL_EXPORT_C IV PerlIOBase_close(pTHX_ PerlIO *f); -PERL_EXPORT_C PerlIO * PerlIOBase_dup(pTHX_ PerlIO *f, PerlIO *o, CLONE_PARAMS *param, int flags); -PERL_EXPORT_C IV PerlIOBase_eof(pTHX_ PerlIO *f); -PERL_EXPORT_C IV PerlIOBase_error(pTHX_ PerlIO *f); -PERL_EXPORT_C IV PerlIOBase_fileno(pTHX_ PerlIO *f); -PERL_EXPORT_C void PerlIOBase_flush_linebuf(pTHX); -PERL_EXPORT_C IV PerlIOBase_noop_fail(pTHX_ PerlIO *f); -PERL_EXPORT_C IV PerlIOBase_noop_ok(pTHX_ PerlIO *f); -PERL_EXPORT_C IV PerlIOBase_popped(pTHX_ PerlIO *f); -PERL_EXPORT_C IV PerlIOBase_pushed(pTHX_ PerlIO *f, const char *mode, SV *arg, PerlIO_funcs *tab); -PERL_EXPORT_C PerlIO * PerlIOBase_open(pTHX_ PerlIO_funcs *self, PerlIO_list_t *layers, IV n, const char *mode, int fd, int imode, int perm, PerlIO *old, int narg, SV **args); -PERL_EXPORT_C SSize_t PerlIOBase_read(pTHX_ PerlIO *f, void *vbuf, Size_t count); -PERL_EXPORT_C void PerlIOBase_setlinebuf(pTHX_ PerlIO *f); -PERL_EXPORT_C SSize_t PerlIOBase_unread(pTHX_ PerlIO *f, const void *vbuf, Size_t count); +PERL_CALLCONV IV PerlIOBase_binmode(pTHX_ PerlIO *f); +PERL_CALLCONV void PerlIOBase_clearerr(pTHX_ PerlIO *f); +PERL_CALLCONV IV PerlIOBase_close(pTHX_ PerlIO *f); +PERL_CALLCONV PerlIO * PerlIOBase_dup(pTHX_ PerlIO *f, PerlIO *o, CLONE_PARAMS *param, int flags); +PERL_CALLCONV IV PerlIOBase_eof(pTHX_ PerlIO *f); +PERL_CALLCONV IV PerlIOBase_error(pTHX_ PerlIO *f); +PERL_CALLCONV IV PerlIOBase_fileno(pTHX_ PerlIO *f); +PERL_CALLCONV void PerlIOBase_flush_linebuf(pTHX); +PERL_CALLCONV IV PerlIOBase_noop_fail(pTHX_ PerlIO *f); +PERL_CALLCONV IV PerlIOBase_noop_ok(pTHX_ PerlIO *f); +PERL_CALLCONV IV PerlIOBase_popped(pTHX_ PerlIO *f); +PERL_CALLCONV IV PerlIOBase_pushed(pTHX_ PerlIO *f, const char *mode, SV *arg, PerlIO_funcs *tab); +PERL_CALLCONV PerlIO * PerlIOBase_open(pTHX_ PerlIO_funcs *self, PerlIO_list_t *layers, IV n, const char *mode, int fd, int imode, int perm, PerlIO *old, int narg, SV **args); +PERL_CALLCONV SSize_t PerlIOBase_read(pTHX_ PerlIO *f, void *vbuf, Size_t count); +PERL_CALLCONV void PerlIOBase_setlinebuf(pTHX_ PerlIO *f); +PERL_CALLCONV SSize_t PerlIOBase_unread(pTHX_ PerlIO *f, const void *vbuf, Size_t count); /* Buf */ -PERL_EXPORT_C Size_t PerlIOBuf_bufsiz(pTHX_ PerlIO *f); -PERL_EXPORT_C IV PerlIOBuf_close(pTHX_ PerlIO *f); -PERL_EXPORT_C PerlIO * PerlIOBuf_dup(pTHX_ PerlIO *f, PerlIO *o, CLONE_PARAMS *param, int flags); -PERL_EXPORT_C IV PerlIOBuf_fill(pTHX_ PerlIO *f); -PERL_EXPORT_C IV PerlIOBuf_flush(pTHX_ PerlIO *f); -PERL_EXPORT_C STDCHAR * PerlIOBuf_get_base(pTHX_ PerlIO *f); -PERL_EXPORT_C SSize_t PerlIOBuf_get_cnt(pTHX_ PerlIO *f); -PERL_EXPORT_C STDCHAR * PerlIOBuf_get_ptr(pTHX_ PerlIO *f); -PERL_EXPORT_C PerlIO * PerlIOBuf_open(pTHX_ PerlIO_funcs *self, PerlIO_list_t *layers, IV n, const char *mode, int fd, int imode, int perm, PerlIO *old, int narg, SV **args); -PERL_EXPORT_C IV PerlIOBuf_popped(pTHX_ PerlIO *f); -PERL_EXPORT_C IV PerlIOBuf_pushed(pTHX_ PerlIO *f, const char *mode, SV *arg, PerlIO_funcs *tab); -PERL_EXPORT_C SSize_t PerlIOBuf_read(pTHX_ PerlIO *f, void *vbuf, Size_t count); -PERL_EXPORT_C IV PerlIOBuf_seek(pTHX_ PerlIO *f, Off_t offset, int whence); -PERL_EXPORT_C void PerlIOBuf_set_ptrcnt(pTHX_ PerlIO *f, STDCHAR * ptr, SSize_t cnt); -PERL_EXPORT_C Off_t PerlIOBuf_tell(pTHX_ PerlIO *f); -PERL_EXPORT_C SSize_t PerlIOBuf_unread(pTHX_ PerlIO *f, const void *vbuf, Size_t count); -PERL_EXPORT_C SSize_t PerlIOBuf_write(pTHX_ PerlIO *f, const void *vbuf, Size_t count); +PERL_CALLCONV Size_t PerlIOBuf_bufsiz(pTHX_ PerlIO *f); +PERL_CALLCONV IV PerlIOBuf_close(pTHX_ PerlIO *f); +PERL_CALLCONV PerlIO * PerlIOBuf_dup(pTHX_ PerlIO *f, PerlIO *o, CLONE_PARAMS *param, int flags); +PERL_CALLCONV IV PerlIOBuf_fill(pTHX_ PerlIO *f); +PERL_CALLCONV IV PerlIOBuf_flush(pTHX_ PerlIO *f); +PERL_CALLCONV STDCHAR * PerlIOBuf_get_base(pTHX_ PerlIO *f); +PERL_CALLCONV SSize_t PerlIOBuf_get_cnt(pTHX_ PerlIO *f); +PERL_CALLCONV STDCHAR * PerlIOBuf_get_ptr(pTHX_ PerlIO *f); +PERL_CALLCONV PerlIO * PerlIOBuf_open(pTHX_ PerlIO_funcs *self, PerlIO_list_t *layers, IV n, const char *mode, int fd, int imode, int perm, PerlIO *old, int narg, SV **args); +PERL_CALLCONV IV PerlIOBuf_popped(pTHX_ PerlIO *f); +PERL_CALLCONV IV PerlIOBuf_pushed(pTHX_ PerlIO *f, const char *mode, SV *arg, PerlIO_funcs *tab); +PERL_CALLCONV SSize_t PerlIOBuf_read(pTHX_ PerlIO *f, void *vbuf, Size_t count); +PERL_CALLCONV IV PerlIOBuf_seek(pTHX_ PerlIO *f, Off_t offset, int whence); +PERL_CALLCONV void PerlIOBuf_set_ptrcnt(pTHX_ PerlIO *f, STDCHAR * ptr, SSize_t cnt); +PERL_CALLCONV Off_t PerlIOBuf_tell(pTHX_ PerlIO *f); +PERL_CALLCONV SSize_t PerlIOBuf_unread(pTHX_ PerlIO *f, const void *vbuf, Size_t count); +PERL_CALLCONV SSize_t PerlIOBuf_write(pTHX_ PerlIO *f, const void *vbuf, Size_t count); /* Crlf */ -PERL_EXPORT_C IV PerlIOCrlf_binmode(pTHX_ PerlIO *f); -PERL_EXPORT_C IV PerlIOCrlf_flush(pTHX_ PerlIO *f); -PERL_EXPORT_C SSize_t PerlIOCrlf_get_cnt(pTHX_ PerlIO *f); -PERL_EXPORT_C IV PerlIOCrlf_pushed(pTHX_ PerlIO *f, const char *mode, SV *arg, PerlIO_funcs *tab); -PERL_EXPORT_C void PerlIOCrlf_set_ptrcnt(pTHX_ PerlIO *f, STDCHAR * ptr, SSize_t cnt); -PERL_EXPORT_C SSize_t PerlIOCrlf_unread(pTHX_ PerlIO *f, const void *vbuf, Size_t count); -PERL_EXPORT_C SSize_t PerlIOCrlf_write(pTHX_ PerlIO *f, const void *vbuf, Size_t count); +PERL_CALLCONV IV PerlIOCrlf_binmode(pTHX_ PerlIO *f); +PERL_CALLCONV IV PerlIOCrlf_flush(pTHX_ PerlIO *f); +PERL_CALLCONV SSize_t PerlIOCrlf_get_cnt(pTHX_ PerlIO *f); +PERL_CALLCONV IV PerlIOCrlf_pushed(pTHX_ PerlIO *f, const char *mode, SV *arg, PerlIO_funcs *tab); +PERL_CALLCONV void PerlIOCrlf_set_ptrcnt(pTHX_ PerlIO *f, STDCHAR * ptr, SSize_t cnt); +PERL_CALLCONV SSize_t PerlIOCrlf_unread(pTHX_ PerlIO *f, const void *vbuf, Size_t count); +PERL_CALLCONV SSize_t PerlIOCrlf_write(pTHX_ PerlIO *f, const void *vbuf, Size_t count); /* Pending */ -PERL_EXPORT_C IV PerlIOPending_close(pTHX_ PerlIO *f); -PERL_EXPORT_C IV PerlIOPending_fill(pTHX_ PerlIO *f); -PERL_EXPORT_C IV PerlIOPending_flush(pTHX_ PerlIO *f); -PERL_EXPORT_C IV PerlIOPending_pushed(pTHX_ PerlIO *f, const char *mode, SV *arg, PerlIO_funcs *tab); -PERL_EXPORT_C SSize_t PerlIOPending_read(pTHX_ PerlIO *f, void *vbuf, Size_t count); -PERL_EXPORT_C IV PerlIOPending_seek(pTHX_ PerlIO *f, Off_t offset, int whence); -PERL_EXPORT_C void PerlIOPending_set_ptrcnt(pTHX_ PerlIO *f, STDCHAR * ptr, SSize_t cnt); +PERL_CALLCONV IV PerlIOPending_close(pTHX_ PerlIO *f); +PERL_CALLCONV IV PerlIOPending_fill(pTHX_ PerlIO *f); +PERL_CALLCONV IV PerlIOPending_flush(pTHX_ PerlIO *f); +PERL_CALLCONV IV PerlIOPending_pushed(pTHX_ PerlIO *f, const char *mode, SV *arg, PerlIO_funcs *tab); +PERL_CALLCONV SSize_t PerlIOPending_read(pTHX_ PerlIO *f, void *vbuf, Size_t count); +PERL_CALLCONV IV PerlIOPending_seek(pTHX_ PerlIO *f, Off_t offset, int whence); +PERL_CALLCONV void PerlIOPending_set_ptrcnt(pTHX_ PerlIO *f, STDCHAR * ptr, SSize_t cnt); /* Pop */ -PERL_EXPORT_C IV PerlIOPop_pushed(pTHX_ PerlIO *f, const char *mode, SV *arg, PerlIO_funcs *tab); +PERL_CALLCONV IV PerlIOPop_pushed(pTHX_ PerlIO *f, const char *mode, SV *arg, PerlIO_funcs *tab); /* Raw */ -PERL_EXPORT_C IV PerlIORaw_pushed(pTHX_ PerlIO *f, const char *mode, SV *arg, PerlIO_funcs *tab); +PERL_CALLCONV IV PerlIORaw_pushed(pTHX_ PerlIO *f, const char *mode, SV *arg, PerlIO_funcs *tab); /* Stdio */ -PERL_EXPORT_C void PerlIOStdio_clearerr(pTHX_ PerlIO *f); -PERL_EXPORT_C IV PerlIOStdio_close(pTHX_ PerlIO *f); -PERL_EXPORT_C PerlIO * PerlIOStdio_dup(pTHX_ PerlIO *f, PerlIO *o, CLONE_PARAMS *param, int flags); -PERL_EXPORT_C IV PerlIOStdio_eof(pTHX_ PerlIO *f); -PERL_EXPORT_C IV PerlIOStdio_error(pTHX_ PerlIO *f); -PERL_EXPORT_C IV PerlIOStdio_fileno(pTHX_ PerlIO *f); +PERL_CALLCONV void PerlIOStdio_clearerr(pTHX_ PerlIO *f); +PERL_CALLCONV IV PerlIOStdio_close(pTHX_ PerlIO *f); +PERL_CALLCONV PerlIO * PerlIOStdio_dup(pTHX_ PerlIO *f, PerlIO *o, CLONE_PARAMS *param, int flags); +PERL_CALLCONV IV PerlIOStdio_eof(pTHX_ PerlIO *f); +PERL_CALLCONV IV PerlIOStdio_error(pTHX_ PerlIO *f); +PERL_CALLCONV IV PerlIOStdio_fileno(pTHX_ PerlIO *f); #ifdef USE_STDIO_PTR -PERL_EXPORT_C STDCHAR * PerlIOStdio_get_ptr(pTHX_ PerlIO *f); -PERL_EXPORT_C SSize_t PerlIOStdio_get_cnt(pTHX_ PerlIO *f); -PERL_EXPORT_C void PerlIOStdio_set_ptrcnt(pTHX_ PerlIO *f, STDCHAR * ptr, SSize_t cnt); +PERL_CALLCONV STDCHAR * PerlIOStdio_get_ptr(pTHX_ PerlIO *f); +PERL_CALLCONV SSize_t PerlIOStdio_get_cnt(pTHX_ PerlIO *f); +PERL_CALLCONV void PerlIOStdio_set_ptrcnt(pTHX_ PerlIO *f, STDCHAR * ptr, SSize_t cnt); #endif -PERL_EXPORT_C IV PerlIOStdio_fill(pTHX_ PerlIO *f); -PERL_EXPORT_C IV PerlIOStdio_flush(pTHX_ PerlIO *f); +PERL_CALLCONV IV PerlIOStdio_fill(pTHX_ PerlIO *f); +PERL_CALLCONV IV PerlIOStdio_flush(pTHX_ PerlIO *f); #ifdef FILE_base -PERL_EXPORT_C STDCHAR * PerlIOStdio_get_base(pTHX_ PerlIO *f); -PERL_EXPORT_C Size_t PerlIOStdio_get_bufsiz(pTHX_ PerlIO *f); +PERL_CALLCONV STDCHAR * PerlIOStdio_get_base(pTHX_ PerlIO *f); +PERL_CALLCONV Size_t PerlIOStdio_get_bufsiz(pTHX_ PerlIO *f); #endif -PERL_EXPORT_C char * PerlIOStdio_mode(const char *mode, char *tmode); -PERL_EXPORT_C PerlIO * PerlIOStdio_open(pTHX_ PerlIO_funcs *self, PerlIO_list_t *layers, IV n, const char *mode, int fd, int imode, int perm, PerlIO *f, int narg, SV **args); -PERL_EXPORT_C IV PerlIOStdio_pushed(pTHX_ PerlIO *f, const char *mode, SV *arg, PerlIO_funcs *tab); -PERL_EXPORT_C SSize_t PerlIOStdio_read(pTHX_ PerlIO *f, void *vbuf, Size_t count); -PERL_EXPORT_C IV PerlIOStdio_seek(pTHX_ PerlIO *f, Off_t offset, int whence); -PERL_EXPORT_C void PerlIOStdio_setlinebuf(pTHX_ PerlIO *f); -PERL_EXPORT_C Off_t PerlIOStdio_tell(pTHX_ PerlIO *f); -PERL_EXPORT_C SSize_t PerlIOStdio_unread(pTHX_ PerlIO *f, const void *vbuf, Size_t count); -PERL_EXPORT_C SSize_t PerlIOStdio_write(pTHX_ PerlIO *f, const void *vbuf, Size_t count); +PERL_CALLCONV char * PerlIOStdio_mode(const char *mode, char *tmode); +PERL_CALLCONV PerlIO * PerlIOStdio_open(pTHX_ PerlIO_funcs *self, PerlIO_list_t *layers, IV n, const char *mode, int fd, int imode, int perm, PerlIO *f, int narg, SV **args); +PERL_CALLCONV IV PerlIOStdio_pushed(pTHX_ PerlIO *f, const char *mode, SV *arg, PerlIO_funcs *tab); +PERL_CALLCONV SSize_t PerlIOStdio_read(pTHX_ PerlIO *f, void *vbuf, Size_t count); +PERL_CALLCONV IV PerlIOStdio_seek(pTHX_ PerlIO *f, Off_t offset, int whence); +PERL_CALLCONV void PerlIOStdio_setlinebuf(pTHX_ PerlIO *f); +PERL_CALLCONV Off_t PerlIOStdio_tell(pTHX_ PerlIO *f); +PERL_CALLCONV SSize_t PerlIOStdio_unread(pTHX_ PerlIO *f, const void *vbuf, Size_t count); +PERL_CALLCONV SSize_t PerlIOStdio_write(pTHX_ PerlIO *f, const void *vbuf, Size_t count); /* Unix */ -PERL_EXPORT_C IV PerlIOUnix_close(pTHX_ PerlIO *f); -PERL_EXPORT_C PerlIO * PerlIOUnix_dup(pTHX_ PerlIO *f, PerlIO *o, CLONE_PARAMS *param, int flags); -PERL_EXPORT_C IV PerlIOUnix_fileno(pTHX_ PerlIO *f); -PERL_EXPORT_C int PerlIOUnix_oflags(const char *mode); -PERL_EXPORT_C PerlIO * PerlIOUnix_open(pTHX_ PerlIO_funcs *self, PerlIO_list_t *layers, IV n, const char *mode, int fd, int imode, int perm, PerlIO *f, int narg, SV **args); -PERL_EXPORT_C IV PerlIOUnix_pushed(pTHX_ PerlIO *f, const char *mode, SV *arg, PerlIO_funcs *tab); -PERL_EXPORT_C SSize_t PerlIOUnix_read(pTHX_ PerlIO *f, void *vbuf, Size_t count); -PERL_EXPORT_C int PerlIOUnix_refcnt_dec(int fd); -PERL_EXPORT_C void PerlIOUnix_refcnt_inc(int fd); -PERL_EXPORT_C int PerlIOUnix_refcnt(int fd); -PERL_EXPORT_C IV PerlIOUnix_seek(pTHX_ PerlIO *f, Off_t offset, int whence); -PERL_EXPORT_C Off_t PerlIOUnix_tell(pTHX_ PerlIO *f); -PERL_EXPORT_C SSize_t PerlIOUnix_write(pTHX_ PerlIO *f, const void *vbuf, Size_t count); +PERL_CALLCONV IV PerlIOUnix_close(pTHX_ PerlIO *f); +PERL_CALLCONV PerlIO * PerlIOUnix_dup(pTHX_ PerlIO *f, PerlIO *o, CLONE_PARAMS *param, int flags); +PERL_CALLCONV IV PerlIOUnix_fileno(pTHX_ PerlIO *f); +PERL_CALLCONV int PerlIOUnix_oflags(const char *mode); +PERL_CALLCONV PerlIO * PerlIOUnix_open(pTHX_ PerlIO_funcs *self, PerlIO_list_t *layers, IV n, const char *mode, int fd, int imode, int perm, PerlIO *f, int narg, SV **args); +PERL_CALLCONV IV PerlIOUnix_pushed(pTHX_ PerlIO *f, const char *mode, SV *arg, PerlIO_funcs *tab); +PERL_CALLCONV SSize_t PerlIOUnix_read(pTHX_ PerlIO *f, void *vbuf, Size_t count); +PERL_CALLCONV int PerlIOUnix_refcnt_dec(int fd); +PERL_CALLCONV void PerlIOUnix_refcnt_inc(int fd); +PERL_CALLCONV int PerlIOUnix_refcnt(int fd); +PERL_CALLCONV IV PerlIOUnix_seek(pTHX_ PerlIO *f, Off_t offset, int whence); +PERL_CALLCONV Off_t PerlIOUnix_tell(pTHX_ PerlIO *f); +PERL_CALLCONV SSize_t PerlIOUnix_write(pTHX_ PerlIO *f, const void *vbuf, Size_t count); /* Utf8 */ -PERL_EXPORT_C IV PerlIOUtf8_pushed(pTHX_ PerlIO *f, const char *mode, SV *arg, PerlIO_funcs *tab); +PERL_CALLCONV IV PerlIOUtf8_pushed(pTHX_ PerlIO *f, const char *mode, SV *arg, PerlIO_funcs *tab); #endif /* _PERLIOL_H */ diff --git a/regexp.h b/regexp.h index 04eeba9..4e94213 100644 --- a/regexp.h +++ b/regexp.h @@ -168,7 +168,7 @@ typedef struct regexp_engine { const U32 flags, re_scream_pos_data *data); SV* (*checkstr) (pTHX_ REGEXP * const rx); - void (*free) (pTHX_ REGEXP * const rx); + void (*rxfree) (pTHX_ REGEXP * const rx); void (*numbered_buff_FETCH) (pTHX_ REGEXP * const rx, const I32 paren, SV * const sv); void (*numbered_buff_STORE) (pTHX_ REGEXP * const rx, const I32 paren, diff --git a/symbian/symbianish.h b/symbian/symbianish.h index a76a755..da5332c 100644 --- a/symbian/symbianish.h +++ b/symbian/symbianish.h @@ -142,11 +142,7 @@ pid_t wait(int *status); # define PERL_UNSET_VARS(v) symbian_unset_vars() #endif /* #ifdef PERL_GLOBAL_STRUCT_PRIVATE */ -#undef PERL_EXPORT_C -#define PERL_EXPORT_C EXPORT_C /* for perlio.h */ #define PERL_CALLCONV EXPORT_C /* for proto.h */ -#undef PERL_XS_EXPORT_C -#define PERL_XS_EXPORT_C EXPORT_C #ifndef PERL_CORE #define PERL_CORE /* for WINS builds under VC */ diff --git a/win32/win32.h b/win32/win32.h index 8a55202..bb155ed 100644 --- a/win32/win32.h +++ b/win32/win32.h @@ -634,14 +634,6 @@ EXTERN_C _CRTIMP ioinfo* __pioinfo[]; #endif #define PERLIO_NOT_STDIO 0 -#include "perlio.h" - -/* - * This provides a layer of functions and macros to ensure extensions will - * get to use the same RTL functions as the core. - */ -#include "win32iop.h" - #define EXEC_ARGV_CAST(x) ((const char *const *) x) DllExport void *win32_signal_context(void); -- 1.7.9.msysgit.0 ```
p5pRT commented 9 years ago

From @tonycoz

On Sun May 10 20​:32​:12 2015\, bulk88 wrote​:

On Sun May 10 18​:12​:50 2015\, tonyc wrote​:

On Sun May 10 13​:50​:00 2015\, bulk88 wrote​:

For 5.23. See attached patch.

Presumably an edit glitch in the patch comment​:

I this in observed in XS-Typemap's DLL.

fixed in attached patch

Thanks

This looks like an unrelated change​:

#define CALLREGFREE_PVT(prog) \ - if(prog) RX_ENGINE(prog)->free(aTHX_ (prog)) + if(prog) RX_ENGINE(prog)->rxfree(aTHX_ (prog))

It doesn't really need a new name\, it could be just​:

#define CALLREGFREE_PVT(prog) \ - if(prog) RX_ENGINE(prog)->free(aTHX_ (prog)) + if(prog) (RX_ENGINE(prog)->free)(aTHX_ (prog))

but should be separate anyway.

Tony

doesn't work ... the define in win32iop.h is

#define free win32_free

not "#define free(a) win32_free(a)"

Thanks for the correction\, added to my post 5.22 branch.

Tony

p5pRT commented 9 years ago

From @tonycoz

On Sun May 10 21​:49​:15 2015\, tonyc wrote​:

On Sun May 10 20​:32​:12 2015\, bulk88 wrote​:

On Sun May 10 18​:12​:50 2015\, tonyc wrote​:

On Sun May 10 13​:50​:00 2015\, bulk88 wrote​:

For 5.23. See attached patch.

Presumably an edit glitch in the patch comment​:

I this in observed in XS-Typemap's DLL.

fixed in attached patch

Thanks

This looks like an unrelated change​:

#define CALLREGFREE_PVT(prog) \ - if(prog) RX_ENGINE(prog)->free(aTHX_ (prog)) + if(prog) RX_ENGINE(prog)->rxfree(aTHX_ (prog))

It doesn't really need a new name\, it could be just​:

#define CALLREGFREE_PVT(prog) \ - if(prog) RX_ENGINE(prog)->free(aTHX_ (prog)) + if(prog) (RX_ENGINE(prog)->free)(aTHX_ (prog))

but should be separate anyway.

Tony

doesn't work ... the define in win32iop.h is

#define free win32_free

not "#define free(a) win32_free(a)"

Thanks for the correction\, added to my post 5.22 branch.

Thanks\, applied to blead as fc6bde6fcee5810d400f6080fe2039469c4d2ad3.

Tony

p5pRT commented 9 years ago

@tonycoz - Status changed from 'open' to 'resolved'

p5pRT commented 9 years ago

@tonycoz - Status changed from 'resolved' to 'pending release'

p5pRT commented 8 years ago

From @khwilliamson

Thank you for submitting this report. You have helped make Perl better.  
With the release of Perl 5.24.0 on May 9\, 2016\, this and 149 other issues have been resolved.

Perl 5.24.0 may be downloaded via https://metacpan.org/release/RJBS/perl-5.24.0

p5pRT commented 8 years ago

@khwilliamson - Status changed from 'pending release' to 'resolved'