summaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1998-05-27 12:50:34 +0000
committerGurusamy Sarathy <gsar@cpan.org>1998-05-27 12:50:34 +0000
commit58a50f6288bdd18f3f469352f83c5e7ade50ee7a (patch)
tree75e3cf009472464e5cedca77f1c708bab1b5fb1e /win32
parent35ff78560a01016ce2a3dffe29f18ce851bc0b90 (diff)
downloadperl-58a50f6288bdd18f3f469352f83c5e7ade50ee7a.tar.gz
[asperl] add AS patch#21 (misc. fixes)
p4raw-id: //depot/asperl@1036
Diffstat (limited to 'win32')
-rw-r--r--win32/GenCAPI.pl16
-rw-r--r--win32/Makefile4
-rw-r--r--win32/makefile.mk20
-rw-r--r--win32/win32.c36
-rw-r--r--win32/win32sck.c3
5 files changed, 56 insertions, 23 deletions
diff --git a/win32/GenCAPI.pl b/win32/GenCAPI.pl
index fe3093308b..67b3de4fa9 100644
--- a/win32/GenCAPI.pl
+++ b/win32/GenCAPI.pl
@@ -50,15 +50,13 @@ debprofdump
debop
debstack
debstackptrs
-deb_place_holder
-deb_growlevel_place_holder
-debprofdump_place_holder
-debop_place_holder
-debstack_place_holder
-debstackptrs_place_holder
+dump_fds
+dump_mstats
fprintf
find_threadsv
magic_mutexfree
+my_memcmp
+my_memset
my_pclose
my_popen
my_swap
@@ -291,7 +289,7 @@ ENDCODE
#undef $name
extern "C" $type $name ($args)
{
- return pPerl->perl_atexit(fn, ptr);
+ pPerl->perl_atexit(fn, ptr);
}
ENDCODE
print OUTFILE "#endif\n" unless ($separateObj == 0);
@@ -1179,11 +1177,11 @@ char ** _Perl_op_name ();
#define Perl_op_name (_Perl_op_name())
#undef Perl_no_modify
-char ** _Perl_no_modify ();
+char * _Perl_no_modify ();
#define Perl_no_modify (_Perl_no_modify())
#undef Perl_opargs
-char ** _Perl_opargs ();
+U32 * _Perl_opargs ();
#define Perl_opargs (_Perl_opargs())
diff --git a/win32/Makefile b/win32/Makefile
index 335485a6d6..c79367682f 100644
--- a/win32/Makefile
+++ b/win32/Makefile
@@ -143,9 +143,9 @@ OPTIMIZE = -Od $(RUNTIME)d -Zi -D_DEBUG -DDEBUGGING
LINK_DBG = -debug -pdb:none
!ELSE
! IF "$(CCTYPE)" == "MSVC20"
-OPTIMIZE = -Od $(RUNTIME) -DNDEBUG
+OPTIMIZE = -O2 $(RUNTIME) -DNDEBUG
! ELSE
-OPTIMIZE = -Od $(RUNTIME) -DNDEBUG
+OPTIMIZE = -O2 $(RUNTIME) -DNDEBUG
! ENDIF
LINK_DBG = -release
!ENDIF
diff --git a/win32/makefile.mk b/win32/makefile.mk
index f74c1be519..b557cdf8d8 100644
--- a/win32/makefile.mk
+++ b/win32/makefile.mk
@@ -226,9 +226,9 @@ OPTIMIZE = -Od $(RUNTIME)d -Zi -D_DEBUG -DDEBUGGING
LINK_DBG = -debug -pdb:none
.ELSE
.IF "$(CCTYPE)" == "MSVC20"
-OPTIMIZE = -Od $(RUNTIME) -DNDEBUG
+OPTIMIZE = -O2 $(RUNTIME) -DNDEBUG
.ELSE
-OPTIMIZE = -Od $(RUNTIME) -DNDEBUG
+OPTIMIZE = -O2 $(RUNTIME) -DNDEBUG
.ENDIF
LINK_DBG = -release
.ENDIF
@@ -300,9 +300,11 @@ EXTUTILSDIR = $(LIBDIR)\extutils
.IF "$(OBJECT)" == "-DPERL_OBJECT"
PERLIMPLIB = ..\perlcore.lib
PERLDLL = ..\perlcore.dll
+CAPILIB = $(COREDIR)\PerlCAPI.lib
.ELSE
PERLIMPLIB = ..\perl.lib
PERLDLL = ..\perl.dll
+CAPILIB =
.ENDIF
MINIPERL = ..\miniperl.exe
@@ -553,7 +555,7 @@ CFG_VARS = \
# Top targets
#
-all : $(GLOBEXE) $(MINIMOD) $(CONFIGPM) $(PERLEXE) $(PERL95EXE) $(X2P) \
+all : $(GLOBEXE) $(MINIMOD) $(CONFIGPM) $(PERLEXE) $(PERL95EXE) $(CAPILIB) $(X2P) \
$(EXTENSION_DLL)
$(DYNALOADER)$(o) : $(DYNALOADER).c $(CORE_H) $(EXTDIR)\DynaLoader\dlutils.c
@@ -753,6 +755,18 @@ $(DYNALOADER).c: $(MINIPERL) $(EXTDIR)\DynaLoader\dl_win32.xs $(CONFIGPM)
cd $(EXTDIR)\$(*B) && $(XSUBPP) dl_win32.xs > $(*B).c
$(XCOPY) $(EXTDIR)\$(*B)\dlutils.c .
+!IF "$(OBJECT)" == "-DPERL_OBJECT"
+PerlCAPI.cpp : $(MINIPERL)
+ $(MINIPERL) GenCAPI.pl $(COREDIR)
+
+PerlCAPI$(o) : PerlCAPI.cpp
+ $(CC) $(CFLAGS_O) -MT -UPERLDLL -DWIN95FIX -c \
+ $(OBJOUT_FLAG)PerlCAPI$(o) PerlCAPI.cpp
+
+$(CAPILIB) : PerlCAPI.cpp PerlCAPI$(o)
+ lib /OUT:$(CAPILIB) PerlCAPI$(o)
+!ENDIF
+
$(EXTDIR)\DynaLoader\dl_win32.xs: dl_win32.xs
copy dl_win32.xs $(EXTDIR)\DynaLoader\dl_win32.xs
diff --git a/win32/win32.c b/win32/win32.c
index d4be76a7bd..56a462a28e 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -978,18 +978,34 @@ win32_getenv(const char *name)
DWORD needlen;
if (!curitem)
New(1305,curitem,curlen,char);
- if (!(needlen = GetEnvironmentVariable(name,curitem,curlen)))
- return Nullch;
- while (needlen > curlen) {
- Renew(curitem,needlen,char);
- curlen = needlen;
- needlen = GetEnvironmentVariable(name,curitem,curlen);
+
+ needlen = GetEnvironmentVariable(name,curitem,curlen);
+ if (needlen != 0) {
+ while (needlen > curlen) {
+ Renew(curitem,needlen,char);
+ curlen = needlen;
+ needlen = GetEnvironmentVariable(name,curitem,curlen);
+ }
}
- if (curitem == NULL)
+ else
{
- if (strcmp("PERL5DB", name) == 0)
+ /* allow any environment variables that begin with 'PERL5'
+ to be stored in the registry
+ */
+ if(curitem != NULL)
+ *curitem = '\0';
+
+ if (strncmp(name, "PERL5", 5) == 0) {
+ if (curitem != NULL) {
+ Safefree(curitem);
+ curitem = NULL;
+ }
curitem = GetRegStr(name, &curitem, &curlen);
+ }
}
+ if(curitem != NULL && *curitem == '\0')
+ return Nullch;
+
return curitem;
}
@@ -1186,6 +1202,10 @@ win32_crypt(const char *txt, const char *salt)
}
#endif
+#ifdef _M_IX86
+#define USE_FIXED_OSFHANDLE
+#endif
+
#ifdef USE_FIXED_OSFHANDLE
EXTERN_C int __cdecl _alloc_osfhnd(void);
diff --git a/win32/win32sck.c b/win32/win32sck.c
index bcf180ad62..74af5d7756 100644
--- a/win32/win32sck.c
+++ b/win32/win32sck.c
@@ -28,6 +28,7 @@ extern CPerlObj* pPerl;
#include "XSUB.h"
#endif
+#include "Win32iop.h"
#include <sys/socket.h>
#include <fcntl.h>
#include <sys/stat.h>
@@ -36,7 +37,7 @@ extern CPerlObj* pPerl;
/* thanks to Beverly Brown (beverly@datacube.com) */
#ifdef USE_SOCKETS_AS_HANDLES
-# define OPEN_SOCKET(x) _open_osfhandle(x,O_RDWR|O_BINARY)
+# define OPEN_SOCKET(x) win32_open_osfhandle(x,O_RDWR|O_BINARY)
# define TO_SOCKET(x) _get_osfhandle(x)
#else
# define OPEN_SOCKET(x) (x)