From: Gurusamy Sarathy Date: Fri, 29 May 1998 00:57:05 +0000 (+0000) Subject: [asperl] fix various shenanigans with C, BC and VC builds now pass X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ab39fa9dbf3b1a1fb7beb555653d0558a089397f;p=p5sagit%2Fp5-mst-13.2.git [asperl] fix various shenanigans with C, BC and VC builds now pass all tests p4raw-id: //depot/asperl@1049 --- diff --git a/globals.c b/globals.c index e3ca27e..1fd3f1e 100644 --- a/globals.c +++ b/globals.c @@ -1444,13 +1444,9 @@ CPerlObj::ErrorNo(void) void CPerlObj::Init(void) { -#ifdef WIN32 - New(2904, environ, 1, char*); - *environ = NULL; -#endif } -#ifdef WIN32 +#ifdef WIN32 /* XXX why are these needed? */ bool do_exec(char *cmd) { diff --git a/win32/Makefile b/win32/Makefile index c793676..0d94244 100644 --- a/win32/Makefile +++ b/win32/Makefile @@ -556,7 +556,7 @@ perlmain.c : runperl.c copy runperl.c perlmain.c perlmain$(o) : perlmain.c - $(CC) $(CFLAGS_O) -UPERLDLL $(EXEOUT_FLAG)$@ -c perlmain.c + $(CC) $(CFLAGS_O) -UPERLDLL $(OBJOUT_FLAG)$@ -c perlmain.c $(PERLEXE): $(PERLDLL) $(CONFIGPM) $(PERLEXE_OBJ) $(LINK32) -subsystem:console -out:$@ $(LINK_FLAGS) $(LIBFILES) \ diff --git a/win32/makefile.mk b/win32/makefile.mk index e482742..872ab83 100644 --- a/win32/makefile.mk +++ b/win32/makefile.mk @@ -705,14 +705,14 @@ perlmain.c : runperl.c copy runperl.c perlmain.c perlmain$(o) : perlmain.c - $(CC) $(CFLAGS_O) -UPERLDLL $(EXEOUT_FLAG)$@ -c perlmain.c + $(CC) $(CFLAGS_O) -UPERLDLL $(OBJOUT_FLAG)$@ -c perlmain.c $(PERLEXE): $(PERLDLL) $(CONFIGPM) $(PERLEXE_OBJ) .IF "$(CCTYPE)" == "BORLAND" $(LINK32) -Tpe -ap $(LINK_FLAGS) \ - @$(mktmp c0x32$(o) $(PERLEXE_OBJ)\n \ - $@,\n \ - $(PERLIMPLIB) $(LIBFILES)\n) + @$(mktmp c0x32$(o) $(PERLEXE_OBJ:s,\,\\)\n \ + $(@:s,\,\\),\n \ + $(LIBFILES) $(PERLIMPLIB)\n) .ELIF "$(CCTYPE)" == "GCC" $(LINK32) -o $@ $(LINK_FLAGS) \ $(PERLEXE_OBJ) $(PERLIMPLIB) $(LIBFILES) diff --git a/win32/runperl.c b/win32/runperl.c index ccb8806..9f2e5c1 100644 --- a/win32/runperl.c +++ b/win32/runperl.c @@ -589,10 +589,8 @@ public: }; virtual PerlIO* Popen(const char *command, const char *mode) { -#ifdef __BORLANDC__ win32_fflush(stdout); win32_fflush(stderr); -#endif return (PerlIO*)win32_popen(command, mode); }; virtual int Pclose(PerlIO *stream) @@ -922,11 +920,10 @@ public: }; inline int PerlParse(int argc, char** argv, char** env) { - char* environ = NULL; int retVal; try { - retVal = pPerl->perl_parse(xs_init, argc, argv, (env == NULL || *env == NULL ? &environ : env)); + retVal = pPerl->perl_parse(xs_init, argc, argv, env); } catch(int x) { @@ -995,7 +992,7 @@ main(int argc, char **argv, char **env) exit(exitstatus); - exitstatus = host.PerlParse(argc, argv, env); + exitstatus = host.PerlParse(argc, argv, NULL); if (!exitstatus) { @@ -1024,7 +1021,6 @@ xs_init(CPERLarg) #else /* PERL_OBJECT */ -/* Say NO to CPP! Hallelujah! */ #ifdef __GNUC__ /* * GNU C does not do __declspec() diff --git a/win32/win32.h b/win32/win32.h index 021cc48..ceee4fe 100644 --- a/win32/win32.h +++ b/win32/win32.h @@ -10,14 +10,12 @@ #define _INC_WIN32_PERL5 #ifdef PERL_OBJECT -#define ENV_HV_NAME "ENV_HV_NAME" -#define DYNAMIC_ENV_FETCH -#define prime_env_iter() -#ifdef PERL_GLOBAL_STRUCT -#error PERL_GLOBAL_STRUCT cannot be defined with PERL_OBJECT -#endif -#define win32_get_stdlib PerlEnv_lib_path -#define win32_get_sitelib PerlEnv_sitelib_path +# define WIN32IO_IS_STDIO /* don't pull in custom stdio layer */ +# ifdef PERL_GLOBAL_STRUCT +# error PERL_GLOBAL_STRUCT cannot be defined with PERL_OBJECT +# endif +# define win32_get_stdlib PerlEnv_lib_path +# define win32_get_sitelib PerlEnv_sitelib_path #endif #ifdef __GNUC__ diff --git a/win32/win32iop.h b/win32/win32iop.h index a17134b..37794f1 100644 --- a/win32/win32iop.h +++ b/win32/win32iop.h @@ -159,7 +159,6 @@ END_EXTERN_C #undef fileno #endif -#ifndef PERL_OBJECT #define stderr win32_stderr() #define stdout win32_stdout() #define stdin win32_stdin() @@ -256,7 +255,6 @@ END_EXTERN_C #define ioctl win32_ioctl #define utime win32_utime #define wait win32_wait -#endif /* PERL_OBJECT */ #ifdef HAVE_DES_FCRYPT #undef crypt @@ -264,10 +262,8 @@ END_EXTERN_C #endif #ifndef USE_WIN32_RTL_ENV -#ifndef PERL_OBJECT #undef getenv #define getenv win32_getenv -#endif /* PERL_OBJECT */ #endif #endif /* WIN32IO_IS_STDIO */