diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 1997-11-26 00:27:57 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1997-11-26 00:27:57 +0000 |
commit | c31fac668b253062b943c71d3452e678b6f02609 (patch) | |
tree | bf9ee12ba220ede3aadb62c3004f00f0cedf9962 | |
parent | 769c30bc4bb5d7abeb7306e297a4071100a0e741 (diff) | |
download | perl-c31fac668b253062b943c71d3452e678b6f02609.tar.gz |
[win32] Various changes to make it build cleanly and pass all tests:
- needed to run `perl embed.pl`
- use PERL_CORE instead of PERLDLL in places that do mean PERL_CORE
- fix prototypes for a few declarations (Borland is finally quiet)
- move declaration of Mymalloc etc to perl.h (since win32 and other
ports may #define malloc themselves, to let extensions bind to
the version that perl used)
- move struct reg_data into a public header file, since it is
referenced in a public datatype
- win32 makefile fixes
- fix remaining s/thread/perl_thread/
p4raw-id: //depot/win32/perl@304
-rw-r--r-- | EXTERN.h | 2 | ||||
-rw-r--r-- | embed.h | 3 | ||||
-rw-r--r-- | ext/DynaLoader/dlutils.c | 10 | ||||
-rw-r--r-- | ext/SDBM_File/sdbm/sdbm.h | 2 | ||||
-rw-r--r-- | hv.c | 9 | ||||
-rw-r--r-- | perl.h | 12 | ||||
-rw-r--r-- | proto.h | 7 | ||||
-rw-r--r-- | regcomp.h | 6 | ||||
-rw-r--r-- | regexp.h | 6 | ||||
-rw-r--r-- | win32/Makefile | 2 | ||||
-rw-r--r-- | win32/dl_win32.xs | 2 | ||||
-rw-r--r-- | win32/makefile.mk | 6 | ||||
-rw-r--r-- | win32/win32.h | 2 | ||||
-rw-r--r-- | win32/win32iop.h | 2 | ||||
-rw-r--r-- | win32/win32thread.c | 6 |
15 files changed, 34 insertions, 43 deletions
@@ -24,7 +24,7 @@ # define dEXTCONST globaldef {"$GLOBAL_RO_VARS"} readonly #else # if (defined(_MSC_VER) && defined(_WIN32)) || (defined(__BORLANDC__) && defined(__WIN32__)) -# ifdef PERLDLL +# ifdef PERL_CORE # define EXT extern __declspec(dllexport) # define dEXT # define EXTCONST extern __declspec(dllexport) const @@ -254,7 +254,6 @@ #define he_root Perl_he_root #define hexdigit Perl_hexdigit #define hints Perl_hints -#define hoistmust Perl_hoistmust #define hv_clear Perl_hv_clear #define hv_delayfree_ent Perl_hv_delayfree_ent #define hv_delete Perl_hv_delete @@ -911,6 +910,8 @@ #define rsignal_save Perl_rsignal_save #define rsignal_state Perl_rsignal_state #define runops Perl_runops +#define runops_debug Perl_runops_debug +#define runops_standard Perl_runops_standard #define rxres_free Perl_rxres_free #define rxres_restore Perl_rxres_restore #define rxres_save Perl_rxres_save diff --git a/ext/DynaLoader/dlutils.c b/ext/DynaLoader/dlutils.c index 58006789ef..422b3d1bf9 100644 --- a/ext/DynaLoader/dlutils.c +++ b/ext/DynaLoader/dlutils.c @@ -26,7 +26,7 @@ static int dl_debug = 0; /* value copied from $DynaLoader::dl_error */ static void -dl_generic_private_init() /* called by dl_*.xs dl_private_init() */ +dl_generic_private_init(void) /* called by dl_*.xs dl_private_init() */ { char *perl_dl_nonlazy; #ifdef DEBUGGING @@ -44,16 +44,8 @@ dl_generic_private_init() /* called by dl_*.xs dl_private_init() */ /* SaveError() takes printf style args and saves the result in LastError */ -#ifdef STANDARD_C static void SaveError(char* pat, ...) -#else -/*VARARGS0*/ -static void -SaveError(pat, va_alist) - char *pat; - va_dcl -#endif { va_list args; char *message; diff --git a/ext/SDBM_File/sdbm/sdbm.h b/ext/SDBM_File/sdbm/sdbm.h index 5bc629f402..ac2dc36b01 100644 --- a/ext/SDBM_File/sdbm/sdbm.h +++ b/ext/SDBM_File/sdbm/sdbm.h @@ -49,7 +49,7 @@ typedef struct { extern datum nullitem; -#if defined(__STDC__) || defined(__cplusplus) +#if defined(__STDC__) || defined(__cplusplus) || defined(CAN_PROTOTYPE) #define proto(p) p #else #define proto(p) () @@ -16,8 +16,8 @@ static void hsplit _((HV *hv)); static void hfreeentries _((HV *hv)); - -static HE* more_he(void); +static void hv_magic_check _((HV *hv, bool *needs_copy, bool *needs_store)); +static HE* more_he _((void)); static HE* new_he(void) @@ -217,10 +217,7 @@ hv_fetch_ent(HV *hv, SV *keysv, I32 lval, register U32 hash) } static void -hv_magic_check (hv, needs_copy, needs_store) -HV *hv; -bool *needs_copy; -bool *needs_store; +hv_magic_check (HV *hv, bool *needs_copy, bool *needs_store) { MAGIC *mg = SvMAGIC(hv); *needs_copy = FALSE; @@ -254,6 +254,8 @@ register struct op *op asm(stringify(OP_IN_REGISTER)); # include <stdlib.h> #endif +#define MEM_SIZE Size_t + /* This comes after <stdlib.h> so we don't try to change the standard * library prototypes; we'll use our own in proto.h instead. */ @@ -264,12 +266,20 @@ register struct op *op asm(stringify(OP_IN_REGISTER)); # define calloc Mycalloc # define realloc Myremalloc # define free Myfree +Malloc_t Mymalloc _((MEM_SIZE nbytes)); +Malloc_t Mycalloc _((MEM_SIZE elements, MEM_SIZE size)); +Malloc_t Myrealloc _((Malloc_t where, MEM_SIZE nbytes)); +Free_t Myfree _((Malloc_t where)); # endif # ifdef EMBEDMYMALLOC # define malloc Perl_malloc # define calloc Perl_calloc # define realloc Perl_realloc # define free Perl_free +Malloc_t Perl_malloc _((MEM_SIZE nbytes)); +Malloc_t Perl_calloc _((MEM_SIZE elements, MEM_SIZE size)); +Malloc_t Perl_realloc _((Malloc_t where, MEM_SIZE nbytes)); +Free_t Perl_free _((Malloc_t where)); # endif # undef safemalloc @@ -283,8 +293,6 @@ register struct op *op asm(stringify(OP_IN_REGISTER)); #endif /* MYMALLOC */ -#define MEM_SIZE Size_t - #if defined(STANDARD_C) && defined(I_STDDEF) # include <stddef.h> # define STRUCT_OFFSET(s,m) offsetof(s,m) @@ -568,13 +568,6 @@ int yylex _((void)); int yyparse _((void)); int yywarn _((char* s)); -#if defined(MYMALLOC) || !defined(STANDARD_C) -Malloc_t malloc _((MEM_SIZE nbytes)); -Malloc_t calloc _((MEM_SIZE elements, MEM_SIZE size)); -Malloc_t realloc _((Malloc_t where, MEM_SIZE nbytes)); -Free_t free _((Malloc_t where)); -#endif - #ifndef MYMALLOC Malloc_t safemalloc _((MEM_SIZE nbytes)); Malloc_t safecalloc _((MEM_SIZE elements, MEM_SIZE size)); @@ -440,12 +440,6 @@ const static char reg_off_by_arg[] = { }; #endif -struct reg_data { - U32 count; - U8 *what; - void* data[1]; -}; - #define REG_SEEN_ZERO_LEN 1 #define REG_SEEN_LOOKBEHIND 2 #define REG_SEEN_GPOS 4 @@ -17,6 +17,12 @@ struct regnode { typedef struct regnode regnode; +struct reg_data { + U32 count; + U8 *what; + void* data[1]; +}; + typedef struct regexp { I32 refcnt; char **startp; diff --git a/win32/Makefile b/win32/Makefile index 91a417da2f..e2d3d446c2 100644 --- a/win32/Makefile +++ b/win32/Makefile @@ -52,7 +52,7 @@ RUNTIME = -MD INCLUDES = -I.\include -I. -I.. #PCHFLAGS = -Fp"$(INTDIR)/modules.pch" -YX DEFINES = -DWIN32 -D_CONSOLE $(BUILDOPT) -LOCDEFS = -DPERLDLL $(CORECCOPT) +LOCDEFS = -DPERLDLL -DPERL_CORE $(CORECCOPT) SUBSYS = console !IF "$(RUNTIME)" == "-MD" diff --git a/win32/dl_win32.xs b/win32/dl_win32.xs index 7b227e299c..cf6797e5fe 100644 --- a/win32/dl_win32.xs +++ b/win32/dl_win32.xs @@ -28,7 +28,7 @@ calls. #include "dlutils.c" /* SaveError() etc */ static void -dl_private_init() +dl_private_init(void) { (void)dl_generic_private_init(); } diff --git a/win32/makefile.mk b/win32/makefile.mk index 03788c731e..7bbf0bb426 100644 --- a/win32/makefile.mk +++ b/win32/makefile.mk @@ -55,7 +55,7 @@ CCLIBDIR = $(CCHOME)\lib CC = bcc32 LINK32 = tlink32 LIB32 = tlib -IMPLIB = implib +IMPLIB = implib -c # # Options @@ -64,7 +64,7 @@ RUNTIME = -D_RTLDLL INCLUDES = -I.\include -I. -I.. -I$(CCINCDIR) #PCHFLAGS = -H -H$(INTDIR)\bcmoduls.pch DEFINES = -DWIN32 $(BUILDOPT) -LOCDEFS = -DPERLDLL +LOCDEFS = -DPERLDLL -DPERL_CORE SUBSYS = console LIBC = cw32mti.lib LIBFILES = import32.lib $(LIBC) odbc32.lib odbccp32.lib @@ -97,7 +97,7 @@ RUNTIME = -MD INCLUDES = -I.\include -I. -I.. #PCHFLAGS = -Fp$(INTDIR)\vcmoduls.pch -YX DEFINES = -DWIN32 -D_CONSOLE $(BUILDOPT) -LOCDEFS = -DPERLDLL +LOCDEFS = -DPERLDLL -DPERL_CORE SUBSYS = console .IF "$(RUNTIME)" == "-MD" diff --git a/win32/win32.h b/win32/win32.h index 2e31d0e3ba..d0dde7e53f 100644 --- a/win32/win32.h +++ b/win32/win32.h @@ -151,7 +151,7 @@ typedef char * caddr_t; /* In malloc.c (core address). */ /* #define PERL_SBRK_VIA_MALLOC /**/ #endif -#ifdef PERLDLL +#if defined(PERLDLL) && !defined(PERL_CORE) #define PERL_CORE #endif diff --git a/win32/win32iop.h b/win32/win32iop.h index bd70def18e..533370e99e 100644 --- a/win32/win32iop.h +++ b/win32/win32iop.h @@ -220,7 +220,7 @@ END_EXTERN_C #define getchar win32_getchar #define putchar win32_putchar -#if !defined(MYMALLOC) || !defined(PERLDLL) +#if !defined(MYMALLOC) || !defined(PERL_CORE) #undef malloc #undef calloc #undef realloc diff --git a/win32/win32thread.c b/win32/win32thread.c index 3e63327638..039f8b4b6f 100644 --- a/win32/win32thread.c +++ b/win32/win32thread.c @@ -1,15 +1,15 @@ #include "EXTERN.h" #include "perl.h" -__declspec(thread) struct thread *Perl_current_thread = NULL; +__declspec(thread) struct perl_thread *Perl_current_thread = NULL; void -Perl_setTHR(struct thread *t) +Perl_setTHR(struct perl_thread *t) { Perl_current_thread = t; } -struct thread * +struct perl_thread * Perl_getTHR(void) { return Perl_current_thread; |