[asperl] fix various shenanigans with C<environ>, BC and VC builds now pass
authorGurusamy Sarathy <gsar@cpan.org>
Fri, 29 May 1998 00:57:05 +0000 (00:57 +0000)
committerGurusamy Sarathy <gsar@cpan.org>
Fri, 29 May 1998 00:57:05 +0000 (00:57 +0000)
all tests

p4raw-id: //depot/asperl@1049

globals.c
win32/Makefile
win32/makefile.mk
win32/runperl.c
win32/win32.h
win32/win32iop.h

index e3ca27e..1fd3f1e 100644 (file)
--- 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)
 {
index c793676..0d94244 100644 (file)
@@ -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) \
index e482742..872ab83 100644 (file)
@@ -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)
index ccb8806..9f2e5c1 100644 (file)
@@ -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()
index 021cc48..ceee4fe 100644 (file)
 #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__
index a17134b..37794f1 100644 (file)
@@ -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 */