From: Gurusamy Sarathy Date: Tue, 28 Dec 1999 18:40:19 +0000 (+0000) Subject: Win9x + GCC update from Benjamin Stuhl X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5db1039675bdeda8d9e4e8a1462abefb8ede0419;p=p5sagit%2Fp5-mst-13.2.git Win9x + GCC update from Benjamin Stuhl p4raw-id: //depot/perl@4729 --- diff --git a/EXTERN.h b/EXTERN.h index 9d31124..c813f81 100644 --- a/EXTERN.h +++ b/EXTERN.h @@ -27,7 +27,7 @@ # define EXTCONST globalref # define dEXTCONST globaldef {"$GLOBAL_RO_VARS"} readonly #else -# if defined(WIN32) && !defined(PERL_STATIC_SYMS) && !defined(__GNUC__) && !defined(PERL_OBJECT) +# if defined(WIN32) && !defined(PERL_STATIC_SYMS) && !defined(PERL_OBJECT) # ifdef PERLDLL # define EXT extern __declspec(dllexport) # define dEXT diff --git a/INTERN.h b/INTERN.h index 118e47c..c2407f2 100644 --- a/INTERN.h +++ b/INTERN.h @@ -27,11 +27,17 @@ # define EXTCONST globaldef {"$GLOBAL_RO_VARS"} readonly # define dEXTCONST globaldef {"$GLOBAL_RO_VARS"} readonly #else -# ifdef __cplusplus -# define EXT -# define dEXT -# define EXTCONST extern const -# define dEXTCONST const +#ifdef WIN32 +# define EXT __declspec(dllexport) +# define dEXT __declspec(dllexport) +# define EXTCONST __declspec(dllexport) const +# define dEXTCONST __declspec(dllexport) const +#else +#ifdef __cplusplus +# define EXT +# define dEXT +# define EXTCONST extern const +# define dEXTCONST const #else # define EXT # define dEXT @@ -39,6 +45,7 @@ # define dEXTCONST const #endif #endif +#endif #undef INIT #define INIT(x) = x diff --git a/MANIFEST b/MANIFEST index d483545..bd42382 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1542,15 +1542,12 @@ win32/config_h.PL Perl code to convert Win32 config.sh to config.h win32/config_sh.PL Perl code to update Win32 config.sh from Makefile win32/des_fcrypt.patch Win32 port win32/dl_win32.xs Win32 port -win32/genmk95.pl Perl code to generate command.com-usable makew95.mk -win32/gstartup.c GCC/Mingw32 runtime startup code +win32/genmk95.pl Perl code to generate command.com-usable makefile.95 win32/include/arpa/inet.h Win32 port win32/include/dirent.h Win32 port win32/include/netdb.h Win32 port win32/include/sys/socket.h Win32 port win32/makefile.mk Win32 makefile for DMAKE (BC++, VC++ builds) -win32/oldnames.def Win32 DLL definition file for GCC-specific implib -win32/PerlCRT.def Win32 DLL definition file for PerlCRT.dll win32/perlglob.c Win32 port win32/perlhost.h Perl "host" implementation win32/perllib.c Win32 port diff --git a/README.win32 b/README.win32 index 2420e64..37df1d4 100644 --- a/README.win32 +++ b/README.win32 @@ -47,11 +47,11 @@ following compilers: Borland C++ version 5.02 or later Microsoft Visual C++ version 4.2 or later - Mingw32 with EGCS versions 1.0.2, 1.1 - Mingw32 with GCC version 2.8.1 + Mingw32 with GCC version 2.95.2 or better -The last two of these are high quality freeware compilers. Support -for them is still experimental. +The last of these is a high quality freeware compiler. Support +for it is still experimental. (Older versions of GCC are known +not to work.) This port currently supports MakeMaker (the set of modules that is used to build extensions to perl). Therefore, you should be @@ -92,6 +92,11 @@ A port of dmake for win32 platforms is available from: ftp://ftp.linux.activestate.com/pub/staff/gsar/dmake-4.1-win32.zip +(This is a fixed version of original dmake sources obtained from +http://www.wticorp.com/dmake/. As of version 4.1PL1, the original +sources did not build as shipped, and had various other problems. +A patch is included in the above fixed version.) + Fetch and install dmake somewhere on your path (follow the instructions in the README.NOW file). @@ -108,24 +113,17 @@ and edit win32/config.vc to change "make=nmake" into "make=dmake". The latter step is only essential if you want to use dmake as your default make for building extensions using MakeMaker. -=item Mingw32 with EGCS or GCC +=item Mingw32 with GCC -ECGS binaries can be downloaded from: +GCC-2.95.2 binaries can be downloaded from: ftp://ftp.xraylith.wisc.edu/pub/khan/gnu-win32/mingw32/ -GCC-2.8.1 binaries are available from: - - http://agnes.dida.physik.uni-essen.de/~janjaap/mingw32/ +The GCC-2.95.2 bundle comes with Mingw32 libraries and headers. -You only need either one of those, not both. Both bundles come with -Mingw32 libraries and headers. While both of them work to build perl, -the EGCS binaries are currently favored by the maintainers, since they -come with more up-to-date Mingw32 libraries. - -Make sure you install the binaries as indicated in the web sites -above. You will need to set up a few environment variables (usually -run from a batch file). +Make sure you install the binaries as indicated in the README for +the GCC bundle. You may need to set up a few environment variables +(usually run from a batch file). You also need dmake. See L above on how to get it. @@ -160,7 +158,7 @@ is typically requested through: perl Makefile.PL CAPI=TRUE PERL_OBJECT requires VC++ 5.0 (Service Pack 3 recommended) or later. It -is not yet supported under GCC or EGCS. WARNING: Binaries built with +is not yet supported under GCC. WARNING: Binaries built with PERL_OBJECT enabled are B compatible with binaries built without. Perl installs PERL_OBJECT binaries under a distinct architecture name, so they B coexist, though. @@ -745,10 +743,8 @@ L This port was originally contributed by Gary Ng around 5.003_24, and borrowed from the Hip Communications port that was available -at the time. - -Nick Ing-Simmons and Gurusamy Sarathy have made numerous and -sundry hacks since then. +at the time. Various people have made numerous and sundry hacks +since then. Borland support was added in 5.004_01 (Gurusamy Sarathy). @@ -756,7 +752,10 @@ GCC/mingw32 support was added in 5.005 (Nick Ing-Simmons). Support for PERL_OBJECT was added in 5.005 (ActiveState Tool Corp). -Last updated: 18 January 1999 +Support for fork() emulation was added in 5.6 (ActiveState Tool Corp). -=cut +Win9x support was added in 5.6 (Benjamin Stuhl). + +Last updated: 28 December 1999 +=cut diff --git a/iperlsys.h b/iperlsys.h index 0d9f699..7b20d5d 100644 --- a/iperlsys.h +++ b/iperlsys.h @@ -344,7 +344,7 @@ struct _PerlIO; #ifndef PerlIO_stdoutf extern int PerlIO_stdoutf (const char *,...) - __attribute__((format (printf, 1, 2))); + __attribute__((__format__ (__printf__, 1, 2))); #endif #ifndef PerlIO_puts extern int PerlIO_puts (PerlIO *,const char *); @@ -405,11 +405,11 @@ extern void PerlIO_setlinebuf (PerlIO *); #endif #ifndef PerlIO_printf extern int PerlIO_printf (PerlIO *, const char *,...) - __attribute__((format (printf, 2, 3))); + __attribute__((__format__ (__printf__, 2, 3))); #endif #ifndef PerlIO_sprintf extern int PerlIO_sprintf (char *, int, const char *,...) - __attribute__((format (printf, 3, 4))); + __attribute__((__format__ (__printf__, 3, 4))); #endif #ifndef PerlIO_vprintf extern int PerlIO_vprintf (PerlIO *, const char *, va_list); diff --git a/lib/ExtUtils/MM_Win32.pm b/lib/ExtUtils/MM_Win32.pm index ab8570d..499b57c 100644 --- a/lib/ExtUtils/MM_Win32.pm +++ b/lib/ExtUtils/MM_Win32.pm @@ -485,13 +485,11 @@ sub dynamic_lib { my($ldfrom) = '$(LDFROM)'; my(@m); -# several things for GCC/Mingw32: -# 1. use correct CRT startup objects (possibly unnecessary) -# 2. try to overcome non-relocateable-DLL problems by generating +# one thing for GCC/Mingw32: +# we try to overcome non-relocateable-DLL problems by generating # a (hopefully unique) image-base from the dll's name # -- BKS, 10-19-1999 if ($GCC) { - $otherldflags .= ' -L$(PERL_ARCHIVE:d) -nostdlib $(PERL_ARCHIVE:d)gdllcrt0.o '; my $dllname = $self->{BASEEXT} . "." . $self->{DLEXT}; $dllname =~ /(....)(.{0,4})/; my $baseaddr = unpack("n", $1 ^ $2); diff --git a/makedef.pl b/makedef.pl index eb599c9..94242ff 100644 --- a/makedef.pl +++ b/makedef.pl @@ -116,14 +116,8 @@ if ($PLATFORM eq 'win32') { # exit(0); } else { - if ($CCTYPE ne 'GCC') { - print "LIBRARY Perl\n"; - print "DESCRIPTION 'Perl interpreter, export autogenerated'\n"; - } - else { - $define{'PERL_GLOBAL_STRUCT'} = 1; - $define{'MULTIPLICITY'} = 1; - } + print "LIBRARY Perl\n"; + print "DESCRIPTION 'Perl interpreter, export autogenerated'\n"; print "EXPORTS\n"; } } diff --git a/win32/Makefile b/win32/Makefile index 301b804..b3c6e56 100644 --- a/win32/Makefile +++ b/win32/Makefile @@ -76,6 +76,7 @@ INST_ARCH = \$(ARCHNAME) # # uncomment to enable the implicit "host" layer for all system calls # made by perl. This is needed and auto-enabled by USE_OBJECT above. +# This is also needed to get fork(). # #USE_IMP_SYS = define @@ -93,7 +94,7 @@ INST_ARCH = \$(ARCHNAME) # # uncomment to enable use of PerlCRT.DLL when using the Visual C compiler. -# Highly recommended. It has patches that fix known bugs in MSVCRT.DLL. +# It has patches that fix known bugs in older versions of MSVCRT.DLL. # This currently requires VC 5.0 with Service Pack 3 or later. # Get it from CPAN at http://www.perl.com/CPAN/authors/id/D/DO/DOUGL/ # and follow the directions in the package to install. @@ -161,7 +162,11 @@ CCLIBDIR = $(CCHOME)\lib # #BUILDOPT = $(BUILDOPT) -DPERL_EXTERNAL_GLOB -# Enabling this runs a cloned toplevel interpreter (fails tests) +# Enabling this causes perl to do its own CR/LF conversions, and is required +# if you want to be able to use the bytecode compiler and ByteLoader +BUILDOPT = $(BUILDOPT) -DUSE_BINMODE_SCRIPTS + +# Enabling this runs a cloned toplevel interpreter (*EXPERIMENTAL*, fails tests) #BUILDOPT = $(BUILDOPT) -DTOP_CLONE # specify semicolon-separated list of extra directories that modules will diff --git a/win32/PerlCRT.def b/win32/PerlCRT.def deleted file mode 100644 index 6376e5a..0000000 --- a/win32/PerlCRT.def +++ /dev/null @@ -1,701 +0,0 @@ -; -; PerlCRT.def -; -; Dll export file for PerlCRT.dll -; this is needed for GCC/Mingw32 builds of Perl, since GCC -; can't understand MSVC-ish .lib files -; -; Created from the output of 'nm PerlCRT.lib | grep "00000000 T"' -; -- Benjamin Stuhl 10-17-1999 - -EXPORTS - wscanf - wprintf - wctomb - wcsxfrm - wcstoul - wcstombs - wcstol - wcstok - wcstod - wcsstr - wcsspn - wcsrchr - wcspbrk - wcsncpy - wcsncmp - wcsncat - wcslen - wcsftime - wcscspn - wcscpy - wcscoll - wcscmp - wcschr - wcscat - vwprintf - vswprintf - vsprintf - vprintf - vfwprintf - vfprintf - ungetwc - ungetc - towupper - towlower - toupper - tolower - tmpnam - tmpfile - time - tanh - tan - system - swscanf - swprintf - strxfrm - strtoul - strtol - strtok - strtod - strstr - strspn - strrchr - strpbrk - strncpy - strncmp - strncat - strlen - strftime - strerror - strcspn - strcpy - strcoll - strcmp - strchr - strcat - sscanf - srand - sqrt - sprintf - sinh - sin - signal - setvbuf - setlocale - setbuf - scanf - rewind - rename - remove - realloc - rand - raise - qsort - putwchar - putwc - puts - putchar - putc - printf - pow - perror - modf - mktime - memset - memmove - memcpy - memcmp - memchr - mbtowc - mbstowcs - mblen - malloc - longjmp - log10 - log - localtime - localeconv - ldiv - ldexp - labs - isxdigit - iswxdigit - iswupper - iswspace - iswpunct - iswprint - iswlower - iswgraph - iswdigit - iswctype - iswcntrl - iswascii - iswalpha - iswalnum - isupper - isspace - ispunct - isprint - islower - isleadbyte - isgraph - isdigit - iscntrl - isalpha - isalnum - is_wctype - gmtime - getwchar - getwc - gets - getenv - getchar - getc - fwscanf - fwrite - fwprintf - ftell - fsetpos - fseek - fscanf - frexp - freopen - free - fread - fputws - fputwc - fputs - fputc - fprintf - fopen - fmod - floor - fgetws - fgetwc - fgets - fgetpos - fgetc - fflush - ferror - feof - fclose - fabs - exp - exit - div - difftime - ctime - cosh - cos - clock - clearerr - ceil - calloc - bsearch - atol - atoi - atof - atan2 - atan - asin - asctime - acos - abs - abort - _yn - _y1 - _y0 - _wutime - _wunlink - _wtol - _wtoi64 - _wtoi - _wtmpnam - _wtempnam - _wsystem - _wstrtime - _wstrdate - _wstati64 - _wstat - _wsplitpath - _wspawnvpe - _wspawnvp - _wspawnve - _wspawnv - _wspawnlpe - _wspawnlp - _wspawnle - _wspawnl - _wsopen - _wsetlocale - _wsearchenv - _wrmdir - _write - _wrename - _wremove - _wputenv - _wpopen - _wperror - _wopen - _wmktemp - _wmkdir - _wmakepath - _wgetenv - _wgetdcwd - _wgetcwd - _wfullpath - _wfsopen - _wfreopen - _wfopen - _wfindnexti64 - _wfindnext - _wfindfirsti64 - _wfindfirst - _wfdopen - _wexecvpe - _wexecvp - _wexecve - _wexecv - _wexeclpe - _wexeclp - _wexecle - _wexecl - _wctime - _wcsupr - _wcsset - _wcsrev - _wcsnset - _wcsnicoll - _wcsnicmp - _wcsncoll - _wcslwr - _wcsicoll - _wcsicmp - _wcsdup - _wcreat - _wchmod - _wchdir - _wasctime - _waccess - _vsnwprintf - _vsnprintf - _utime - _unlock - _unloaddll - _unlink - _ungetch - _umask - _ultow - _ultoa - _ui64tow - _ui64toa - _tzset - _toupper - _tolower - _tempnam - _telli64 - _tell - _swab - _sys_nerr - _strupr - _strtime - _strset - _strrev - _strnset - _strnicoll - _strnicmp - _strncoll - _strlwr - _stricoll - _stricmp - _strerror - _strdup - _strdate - _strcmpi - _statusfp - _stati64 - _stat - _splitpath - _spawnvpe - _spawnvp - _spawnve - _spawnv - _spawnlpe - _spawnlp - _spawnle - _spawnl - _sopen - _snwprintf - _snprintf - _sleep - _setsystime - _setmode - _setmbcp - _setmaxstdio - _setjmp3 - _setjmp - _seterrormode - _set_sbh_threshold - _set_error_mode - _seh_longjmp_unwind@4 - _searchenv - _scalb - _safe_fprem1 - _safe_fprem - _safe_fdivr - _safe_fdiv - _rotr - _rotl - _rmtmp - _rmdir - _read - _putws - _putw - _putenv - _putch - _purecall - _popen - _pipe - _pclose - _outpw - _outpd - _outp - _open_osfhandle - _open - _nextafter - _msize - _mktemp - _mkdir - _memicmp - _memccpy - _mbsupr - _mbstrlen - _mbstok - _mbsstr - _mbsspnp - _mbsspn - _mbsset - _mbsrev - _mbsrchr - _mbspbrk - _mbsnset - _mbsninc - _mbsnicoll - _mbsnicmp - _mbsnextc - _mbsncpy - _mbsncoll - _mbsncmp - _mbsnccnt - _mbsncat - _mbsnbset - _mbsnbicoll - _mbsnbicmp - _mbsnbcpy - _mbsnbcoll - _mbsnbcnt - _mbsnbcmp - _mbsnbcat - _mbslwr - _mbslen - _mbsinc - _mbsicoll - _mbsicmp - _mbsdup - _mbsdec - _mbscspn - _mbscpy - _mbscoll - _mbscmp - _mbschr - _mbscat - _mbsbtype - _mbctoupper - _mbctombb - _mbctolower - _mbctokata - _mbctohira - _mbclen - _mbcjmstojis - _mbcjistojms - _mbccpy - _mbbtype - _mbbtombc - _makepath - _ltow - _ltoa - _lseeki64 - _lseek - _lsearch - _lrotr - _lrotl - _longjmpex - _logb - _locking - _lock - _local_unwind2 - _loaddll - _lfind - _kbhit - _jn - _j1 - _j0 - _itow - _itoa - _isnan - _ismbstrail - _ismbslead - _ismbcupper - _ismbcsymbol - _ismbcspace - _ismbcpunct - _ismbcprint - _ismbclower - _ismbclegal - _ismbcl2 - _ismbcl1 - _ismbcl0 - _ismbckata - _ismbchira - _ismbcgraph - _ismbcdigit - _ismbcalpha - _ismbcalnum - _ismbbtrail - _ismbbpunct - _ismbbprint - _ismbblead - _ismbbkpunct - _ismbbkprint - _ismbbkana - _ismbbkalnum - _ismbbgraph - _ismbbalpha - _ismbbalnum - _isctype - _isatty - _inpw - _inpd - _inp - _initterm - _iob - _i64tow - _i64toa - _hypot - _HUGE - _heapwalk - _heapused - _heapset - _heapmin - _heapchk - _heapadd - _global_unwind2 - _getws - _getw - _getsystime - _getpid - _getmbcp - _getmaxstdio - _getdrives - _getdrive - _getdllprocaddr - _getdiskfree - _getdcwd - _getcwd - _getche - _getch - _get_sbh_threshold - _get_osfhandle - _gcvt - _futime - _fullpath - _ftol - _ftime - _fstati64 - _fstat - _fsopen - _free_osfhnd - _fputwchar - _fputchar - _fpreset - _fpieee_flt - _fpclass - _fmode - _flushall - _flsbuf - _finite - _findnexti64 - _findnext - _findfirsti64 - _findfirst - _findclose - _fileno - _filelengthi64 - _filelength - _filbuf - _fgetwchar - _fgetchar - _fdopen - _fcvt - _fcloseall - _expand - _exit - _execvpe - _execvp - _execve - _execv - _execlpe - _execlp - _execle - _execl - _except_handler3 - _except_handler2 - _errno - _eof - _endthreadex - _endthread - _ecvt - _dup2 - _dup - _cwait - _cscanf - _creat - _cputs - _cprintf - _copysign - _controlfp - _control87 - _commit - _close - _clearfp - _chsize - _chmod - _chgsign - _chdrive - _chdir - _cgets - _cexit - _callnewh - _cabs - _c_exit - _beginthreadex - _beginthread - _beep - _atoldbl - _atoi64 - _atodbl - _assert - _amsg_exit - _adj_fptan - _adj_fprem1 - _adj_fprem - _adj_fpatan - _adj_fdivr_m64 - _adj_fdivr_m32i - _adj_fdivr_m32 - _adj_fdivr_m16i - _adj_fdiv_r - _adj_fdiv_m64 - _adj_fdiv_m32i - _adj_fdiv_m32 - _adj_fdiv_m16i - _access - _abnormal_termination - __wgetmainargs - __unDName - __toascii - __threadid - __threadhandle - __setusermatherr - __set_app_type - __pxcptinfoptrs - __p__wpgmptr - __p__winver - __p__winminor - __p__winmajor - __p__wenviron - __p__wcmdln - __p__tzname - __p__timezone - __p__pwctype - __p__pgmptr - __p__pctype - __p__osver - __p__mbctype - __p__mbcasemap - __p__iob - __p__fmode - __p__fileinfo - __p__environ - __p__dstbias - __p__daylight - __p__commode - __p__amblksiz - __p__acmdln - __p___winitenv - __p___wargv - __p___mb_cur_max - __p___initenv - __p___argv - __p___argc - __lconv_init - __iscsymf - __iscsym - __isascii - __getmainargs - __fpecode - __doserrno - __dllonexit - __crtLCMapStringA - __crtGetLocaleInfoW - __crtCompareStringA - __STRINGTOLD - __RTtypeid - __RTDynamicCast - __RTCastToVoid - __CxxLongjmpUnwind@4 - __CxxFrameHandler - _XcptFilter - _Strftime - _Gettnames - _Getmonths - _Getdays - _EH_prolog - _CxxThrowException@8 - _CItanh - _CItan - _CIsqrt - _CIsinh - _CIsin - _CIpow - _CIlog10 - _CIlog - _CIfmod - _CIexp - _CIcosh - _CIcos - _CIatan2 - _CIatan - _CIasin - _CIacos - $I10_OUTPUT - _aullshr - _aullrem - _aulldiv - _allshr - _allshl - _allrem - _allmul - _alldiv - _setdefaultprecision - _wsetargv - _matherr - _setargv - __setargv - _CRT_INIT@12 - _DllMainCRTStartup@12 - _onexit - atexit - _alloca_probe - _chkstk diff --git a/win32/config.gc b/win32/config.gc index ac0345f..ff2da57 100644 --- a/win32/config.gc +++ b/win32/config.gc @@ -297,8 +297,8 @@ d_statvfs='undef' d_stdio_cnt_lval='define' d_stdio_ptr_lval='define' d_stdio_stream_array='undef' -d_stdiobase='undef' -d_stdstdio='undef' +d_stdiobase='define' +d_stdstdio='define' d_strchr='define' d_strcoll='define' d_strctcpy='define' @@ -323,7 +323,7 @@ d_telldirproto='define' d_time='define' d_times='define' d_truncate='undef' -d_tzname='undef' +d_tzname='define' d_umask='define' d_uname='define' d_union_semun='define' @@ -496,7 +496,7 @@ ldflags='~LINK_FLAGS~' ldlibpthname='' less='less' lib_ext='.a' -libc='libcrtdll.a' +libc='libmsvcrt.a' libperl='libperl.a' libpth='' libs='' @@ -691,7 +691,7 @@ uselargefiles='undef' uselongdouble='undef' uselonglong='undef' usemorebits='undef' -usemultiplicity='define' +usemultiplicity='undef' usemymalloc='n' usenm='false' useopcode='true' diff --git a/win32/genmk95.pl b/win32/genmk95.pl index 6137ce2..8fe4f86 100644 --- a/win32/genmk95.pl +++ b/win32/genmk95.pl @@ -45,9 +45,12 @@ while (<$in>) next; } else { - seek ($out, -3, 2); # no recipe, so back up and undo grouping + if (!/^\t/) { + seek ($out, -4, 2); # no recipe, so back up and undo grouping + # should be -3, but MS has its CR/LF thing... + $inrec = 0; + } print $out "$_\n"; - $inrec = 0; next; } } diff --git a/win32/gstartup.c b/win32/gstartup.c deleted file mode 100644 index fc107e2..0000000 --- a/win32/gstartup.c +++ /dev/null @@ -1,324 +0,0 @@ -/* - * gstartup.c - * - * Startup file for GCC/Mingw32 builds - * (replaces gcc's default c:\egcs\...\{crt1.o,dllcrt1.o}) - * - * This file is taken from the Mingw32 package. - * Created by Colin Peters for Mingw32 - * Modified by Mumit Khan - * - * History with Perl: - * Added (in modified form) to Perl standard distribution to fix - * problems linking against PerlCRT or MSVCRT - * -- Benjamin Stuhl 10-17-1999 -*/ - -#include -#include -#include -#include -#include -#include -#include -#include - -/* - * Access to a standard 'main'-like argument count and list. Also included - * is a table of environment variables. - */ -int _argc; -char **_argv; - -extern int _CRT_glob; - -#ifdef __MSVCRT__ -typedef struct { - int newmode; -} _startupinfo; -extern void __getmainargs (int *, char ***, char ***, int, _startupinfo *); -#else -extern void __GetMainArgs (int *, char ***, char ***, int); -#endif - -/* - * Initialize the _argc, _argv and environ variables. - */ -static void -_mingw32_init_mainargs () -{ - /* The environ variable is provided directly in stdlib.h through - * a dll function call. */ - char **dummy_environ; -#ifdef __MSVCRT__ - _startupinfo start_info; - start_info.newmode = 0; -#endif - - /* - * Microsoft's runtime provides a function for doing just that. - */ -#ifdef __MSVCRT__ - (void) __getmainargs (&_argc, &_argv, &dummy_environ, _CRT_glob, - &start_info); -#else - /* CRTDLL version */ - (void) __GetMainArgs (&_argc, &_argv, &dummy_environ, _CRT_glob); -#endif -} - -#if defined(EXESTARTUP) /* gcrt0.o - startup for an executable */ - -extern int main (int, char **, char **); - -/* - * Must have the correct app type for MSVCRT. - */ - -#ifdef __MSVCRT__ -#define __UNKNOWN_APP 0 -#define __CONSOLE_APP 1 -#define __GUI_APP 2 -__MINGW_IMPORT void __set_app_type(int); -#endif /* __MSVCRT__ */ - -/* - * Setup the default file handles to have the _CRT_fmode mode, as well as - * any new files created by the user. - */ -extern unsigned int _CRT_fmode; - -static void -_mingw32_init_fmode () -{ - /* Don't set the file mode if the user hasn't set any value for it. */ - if (_CRT_fmode) - { - _fmode = _CRT_fmode; - - /* - * This overrides the default file mode settings for stdin, - * stdout and stderr. At first I thought you would have to - * test with isatty, but it seems that the DOS console at - * least is smart enough to handle _O_BINARY stdout and - * still display correctly. - */ - if (stdin) - { - _setmode (_fileno (stdin), _CRT_fmode); - } - if (stdout) - { - _setmode (_fileno (stdout), _CRT_fmode); - } - if (stderr) - { - _setmode (_fileno (stderr), _CRT_fmode); - } - } -} - -/* This function will be called when a trap occurs. Thanks to Jacob - Navia for his contribution. */ -static CALLBACK long -_gnu_exception_handler (EXCEPTION_POINTERS * exception_data) -{ - void (*old_handler) (int); - long action = EXCEPTION_CONTINUE_SEARCH; - int reset_fpu = 0; - - switch (exception_data->ExceptionRecord->ExceptionCode) - { - case EXCEPTION_ACCESS_VIOLATION: - /* test if the user has set SIGSEGV */ - old_handler = signal (SIGSEGV, SIG_DFL); - if (old_handler == SIG_IGN) - { - /* this is undefined if the signal was raised by anything other - than raise (). */ - signal (SIGSEGV, SIG_IGN); - action = EXCEPTION_CONTINUE_EXECUTION; - } - else if (old_handler != SIG_DFL) - { - /* This means 'old' is a user defined function. Call it */ - (*old_handler) (SIGSEGV); - action = EXCEPTION_CONTINUE_EXECUTION; - } - break; - - case EXCEPTION_FLT_INVALID_OPERATION: - case EXCEPTION_FLT_DIVIDE_BY_ZERO: - case EXCEPTION_FLT_DENORMAL_OPERAND: - case EXCEPTION_FLT_OVERFLOW: - case EXCEPTION_FLT_UNDERFLOW: - case EXCEPTION_FLT_INEXACT_RESULT: - reset_fpu = 1; - /* fall through. */ - - case EXCEPTION_INT_DIVIDE_BY_ZERO: - /* test if the user has set SIGFPE */ - old_handler = signal (SIGFPE, SIG_DFL); - if (old_handler == SIG_IGN) - { - signal (SIGFPE, SIG_IGN); - if (reset_fpu) - _fpreset (); - action = EXCEPTION_CONTINUE_EXECUTION; - } - else if (old_handler != SIG_DFL) - { - /* This means 'old' is a user defined function. Call it */ - (*old_handler) (SIGFPE); - action = EXCEPTION_CONTINUE_EXECUTION; - } - break; - - default: - break; - } - return action; -} - -/* - * The function mainCRTStartup is the entry point for all console programs. - */ -static int -__mingw_CRTStartup () -{ - int nRet; - - /* - * Set up the top-level exception handler so that signal handling - * works as expected. The mapping between ANSI/POSIX signals and - * Win32 SE is not 1-to-1, so caveat emptore. - * - */ - SetUnhandledExceptionFilter (_gnu_exception_handler); - - /* - * Initialize floating point unit. - */ - _fpreset (); /* Supplied by the runtime library. */ - - /* - * Set up __argc, __argv and _environ. - */ - _mingw32_init_mainargs (); - - /* - * Sets the default file mode for stdin, stdout and stderr, as well - * as files later opened by the user, to _CRT_fmode. - * NOTE: DLLs don't do this because that would be rude! - */ - _mingw32_init_fmode (); - - /* - * Call the main function. If the user does not supply one - * the one in the 'libmingw32.a' library will be linked in, and - * that one calls WinMain. See main.c in the 'lib' dir - * for more details. - */ - nRet = main (_argc, _argv, environ); - - /* - * Perform exit processing for the C library. This means - * flushing output and calling 'atexit' registered functions. - */ - _cexit (); - - ExitProcess (nRet); - - return 0; -} - -/* - * The function mainCRTStartup is the entry point for all console programs. - */ -int -mainCRTStartup () -{ -#ifdef __MSVCRT__ - __set_app_type (__CONSOLE_APP); -#endif - __mingw_CRTStartup (); - return 0; -} - -/* - * For now the GUI startup function is the same as the console one. - * This simply gets rid of the annoying warning about not being able - * to find WinMainCRTStartup when linking GUI applications. - */ -int -WinMainCRTStartup () -{ -#ifdef __MSVCRT__ - __set_app_type (__GUI_APP); -#endif - __mingw_CRTStartup (); -} - -#elif defined(DLLSTARTUP) /* dllcrt0.o - startup for a DLL */ - -/* Unlike normal crt1, I don't initialize the FPU, because the process - * should have done that already. I also don't set the file handle modes, - * because that would be rude. */ - -#ifdef __GNUC__ -extern void __main (); -extern void __do_global_dtors (); -#endif - -extern BOOL WINAPI DllMain (HANDLE, DWORD, LPVOID); - -BOOL WINAPI -DllMainCRTStartup (HANDLE hDll, DWORD dwReason, LPVOID lpReserved) -{ - BOOL bRet; - - if (dwReason == DLL_PROCESS_ATTACH) - { - _mingw32_init_mainargs (); - -#ifdef __GNUC__ - /* From libgcc.a, calls global class constructors. */ - __main (); -#endif - } - - /* - * Call the user-supplied DllMain subroutine - * NOTE: DllMain is optional, so libmingw32.a includes a stub - * which will be used if the user does not supply one. - */ - bRet = DllMain (hDll, dwReason, lpReserved); - -#ifdef __GNUC__ - if (dwReason == DLL_PROCESS_DETACH) - { - /* From libgcc.a, calls global class destructors. */ - __do_global_dtors (); - } -#endif - - return bRet; -} - -/* - * For the moment a dummy atexit. Atexit causes problems in DLLs, especially - * if they are dynamically loaded. For now atexit inside a DLL does nothing. - * NOTE: We need this even if the DLL author never calls atexit because - * the global constructor function __do_global_ctors called from __main - * will attempt to register __do_global_dtors using atexit. - * Thanks to Andrey A. Smirnov for pointing this one out. - */ -int -atexit (void (*pfn) ()) -{ - return 0; -} - -#else -#error No startup target! -#endif /* EXESTARTUP */ diff --git a/win32/makefile.mk b/win32/makefile.mk index 3b64395..228edca 100644 --- a/win32/makefile.mk +++ b/win32/makefile.mk @@ -1,9 +1,9 @@ # # Makefile to build perl on Windows NT using DMAKE. # Supported compilers: -# Visual C++ 2.0 thro 5.0 +# Visual C++ 2.0 thro 6.0 # Borland C++ 5.02 -# Mingw32 with gcc-2.8.1 or egcs-1.0.2 **experimental** +# Mingw32 with gcc-2.95.2 or better **experimental** # # This is set up to build a perl.exe that runs off a shared library # (perl.dll). Also makes individual DLLs for the XS extensions. @@ -81,6 +81,7 @@ INST_ARCH *= \$(ARCHNAME) # # uncomment to enable the implicit "host" layer for all system calls # made by perl. This is needed and auto-enabled by USE_OBJECT above. +# This is also needed to get fork(). # #USE_IMP_SYS *= define @@ -95,7 +96,7 @@ INST_ARCH *= \$(ARCHNAME) #CCTYPE *= MSVC60 # Borland 5.02 or later CCTYPE *= BORLAND -# mingw32/egcs or mingw32/gcc +# mingw32/gcc-2.95.2 or better #CCTYPE *= GCC # @@ -111,10 +112,9 @@ CCTYPE *= BORLAND #CFG *= Debug # -# uncomment to enable use of PerlCRT.DLL when using the Visual C compiler -# or GCC/Mingw32. Highly recommended. It has patches that fix known bugs in -# MSVCRT.DLL. This currently requires VC 5.0 with Service Pack 3 or later -# or GCC/Mingw32. +# uncomment to enable use of PerlCRT.DLL when using the Visual C compiler. +# It has patches that fix known bugs in older versions of MSVCRT.DLL. +# This currently requires VC 5.0 with Service Pack 3 or later. # Get it from CPAN at http://www.perl.com/CPAN/authors/id/D/DO/DOUGL/ # and follow the directions in the package to install. # @@ -181,7 +181,11 @@ CCLIBDIR *= $(CCHOME)\lib # #BUILDOPT += -DPERL_EXTERNAL_GLOB -# Enabling this runs a cloned toplevel interpreter (fails tests) +# Enabling this causes perl to do its own CR/LF conversions, and is required +# if you want to be able to use the bytecode compiler and ByteLoader +BUILDOPT += -DUSE_BINMODE_SCRIPTS + +# Enabling this runs a cloned toplevel interpreter (*EXPERIMENTAL*, fails tests) #BUILDOPT += -DTOP_CLONE # @@ -348,30 +352,21 @@ a = .a # Options # -# GCC headers need to know that we're using MSVCRT (or a clone thereof) -RUNTIME = -D__MSVCRT__ +RUNTIME = INCLUDES = -I$(COREDIR) -I.\include -I. -I.. DEFINES = -DWIN32 $(CRYPT_FLAG) LOCDEFS = -DPERLDLL -DPERL_CORE SUBSYS = console CXX_FLAG = -xc++ -.IF "$(USE_PERLCRT)" == "" -LIBCDLL = msvcrt.dll -CRTIMPLIBS = $(OLDNAMES_A) -.ELSE -LIBCDLL = PerlCRT.dll -CRTIMPLIBS = $(PERLCRT_A) $(OLDNAMES_A) -.ENDIF - -LIBC = -l$(LIBCDLL:s/.dll//) -GCCLIBS = -lmingw32 -lgcc +LIBC = -lmsvcrt -# same libs as MSVC, but no -luuid32 or -lodbccp32 yet -LIBFILES = $(GCCLIBS) $(CRYPT_LIB) $(LIBC) -loldnames -lkernel32 \ - -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 \ - -lole32 -loleaut32 -lnetapi32 -lwsock32 -lmpr -lwinmm \ - -lversion -lodbc32 +# same libs as MSVC +LIBFILES = $(CRYPT_LIB) $(LIBC) \ + -lmoldname -lkernel32 -luser32 -lgdi32 \ + -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 \ + -loleaut32 -lnetapi32 -luuid -lwsock32 -lmpr \ + -lwinmm -lversion -lodbc32 .IF "$(CFG)" == "Debug" OPTIMIZE = -g $(RUNTIME) -DDEBUGGING @@ -387,9 +382,6 @@ OBJOUT_FLAG = -o EXEOUT_FLAG = -o LIBOUT_FLAG = -# tack COREDIR on for perl build -PRIV_LINK_FLAGS = -L"$(COREDIR)" - .ELSE CC = cl @@ -475,16 +467,11 @@ OPTIMIZE += $(CXX_FLAG) BUILDOPT += -DPERL_OBJECT .ENDIF -CRTIMPLIBS *= __not_needed -PERLCRT_A *= $(COREDIR)\libPerlCRT.a -PERLCRT_DEF *= PerlCRT.def -OLDNAMES_A *= $(COREDIR)\liboldnames.a -OLDNAMES_DEF *= oldnames.def - CFLAGS_O = $(CFLAGS) $(BUILDOPT) -# used to allow local linking flags that are not propogated into Config.pm -# -- BKS, 11-15-1999 +# used to allow local linking flags that are not propogated into Config.pm, +# currently unused +# -- BKS, 12-12-1999 PRIV_LINK_FLAGS *= BLINK_FLAGS = $(PRIV_LINK_FLAGS) $(LINK_FLAGS) @@ -515,7 +502,7 @@ $(o).dll: $(IMPLIB) $(*B).lib $@ .ELIF "$(CCTYPE)" == "GCC" $(LINK32) -o $@ $(BLINK_FLAGS) $< $(LIBFILES) - $(IMPLIB) -def $(*B).def $(*B).a $@ + $(IMPLIB) --input-def $(*B).def --output-lib $(*B).a $@ .ELSE $(LINK32) -dll -subsystem:windows -implib:$(*B).lib -def:$(*B).def \ -out:$@ $(BLINK_FLAGS) $(LIBFILES) $< $(LIBPERL) @@ -734,12 +721,6 @@ X2P_OBJ = $(X2P_SRC:db:+$(o)) PERLDLL_OBJ = $(CORE_OBJ) PERLEXE_OBJ = perlmain$(o) -.IF "$(CCTYPE)" == "GCC" -PERLEXE_OBJ += .\gcrt0$(o) -MINI_OBJ += $(MINIDIR)\gcrt0$(o) -DLL_OBJ += .\gdllcrt0$(o) -.ENDIF - PERLDLL_OBJ += $(WIN32_OBJ) $(DLL_OBJ) .IF "$(USE_SETARGV)" != "" @@ -877,7 +858,7 @@ RIGHTMAKE = __not_needed # Top targets # -all : $(CRTIMPLIBS) .\config.h $(GLOBEXE) $(MINIPERL) $(MK2) \ +all : .\config.h $(GLOBEXE) $(MINIPERL) $(MK2) \ $(RIGHTMAKE) $(MINIMOD) $(CONFIGPM) $(PERLEXE) $(PERL95EXE) \ $(X2P) $(EXTENSION_DLL) $(EXTENSION_PM) @@ -889,7 +870,7 @@ $(DYNALOADER)$(o) : $(DYNALOADER).c $(CORE_H) $(EXTDIR)\DynaLoader\dlutils.c # this target is a jump-off point for Win95 # 1. it switches to the Win95-specific makefile if it exists -# (__do_switc_makefiles) +# (__do_switch_makefiles) # 2. it prints a message when the Win95-specific one finishes (__done) # 3. it then kills this makefile by trying to make __no_such_target @@ -925,36 +906,6 @@ __no_such_target: #--------------------- END Win95 SPECIFIC --------------------- -#--------------------- BEGIN GCC/Mingw32 SPECIFIC ------------- - -# make GCC-ish implib for PerlCRT.dll if needed -$(PERLCRT_A): $(PERLCRT_DEF) - if not exist $(COREDIR) mkdir $(COREDIR) - $(IMPLIB) --def $(PERLCRT_DEF) \ - --dllname $(LIBCDLL) \ - --output-lib $(PERLCRT_A) - -# make GCC-ish oldnames implib for our CRT (whether it's MSVCRT or PerlCRT) -$(OLDNAMES_A): $(OLDNAMES_DEF) - $(IMPLIB) --def $(OLDNAMES_DEF) \ - --dllname $(LIBCDLL) \ - --output-lib $(OLDNAMES_A) \ - --add-underscore - -# MSVCRT-using runtime startup files -$(MINIDIR)\gcrt0$(o): .\gstartup.c - $(CC) -c $(CFLAGS) -DEXESTARTUP $(OBJOUT_FLAG)$@ .\gstartup.c - -.\gcrt0$(o): .\gstartup.c - $(CC) -c $(CFLAGS) -DEXESTARTUP $(OBJOUT_FLAG)$@ .\gstartup.c - -.\gdllcrt0$(o): .\gstartup.c - $(CC) -c $(CFLAGS) -DDLLSTARTUP $(OBJOUT_FLAG)$@ .\gstartup.c - $(XCOPY) $@ $(COREDIR) - - -#--------------------- END GCC/Mingw32 SPECIFIC --------------- - # a blank target for when builds don't need to do certain things # this target added for Win95 port but used to keep the WinNT port able to # use this file @@ -967,7 +918,7 @@ $(GLOBEXE) : perlglob$(o) $(LINK32) -Tpe -ap $(BLINK_FLAGS) c0x32$(o) perlglob$(o) \ "$(CCLIBDIR)\32BIT\wildargs$(o)",$@,,import32.lib cw32mt.lib, .ELIF "$(CCTYPE)" == "GCC" - $(LINK32) $(BLINK_FLAGS) -o $@ perlglob$(o) $(LIBFILES) + $(LINK32) $(BLINK_FLAGS) -mconsole -o $@ perlglob$(o) $(LIBFILES) .ELSE $(LINK32) $(BLINK_FLAGS) $(LIBFILES) -out:$@ -subsystem:$(SUBSYS) \ perlglob$(o) setargv$(o) @@ -1013,7 +964,7 @@ $(MINIPERL) : $(MINIDIR) $(MINI_OBJ) $(CRTIPMLIBS) $(LINK32) -Tpe -ap $(BLINK_FLAGS) \ @$(mktmp c0x32$(o) $(MINI_OBJ:s,\,\\),$(@:s,\,\\),,$(LIBFILES),) .ELIF "$(CCTYPE)" == "GCC" - $(LINK32) -v -nostdlib -o $@ $(BLINK_FLAGS) \ + $(LINK32) -v -mconsole -o $@ $(BLINK_FLAGS) \ $(mktmp $(LKPRE) $(MINI_OBJ:s,\,\\) $(LIBFILES) $(LKPOST)) .ELSE $(LINK32) -subsystem:console -out:$@ \ @@ -1030,9 +981,13 @@ $(MINIWIN32_OBJ) : $(CORE_NOCFG_H) $(CC) -c $(CFLAGS) $(OBJOUT_FLAG)$@ $(*B).c # -DPERL_IMPLICIT_SYS needs C++ for perllib.c -.IF "$(USE_IMP_SYS)$(USE_OBJECT)" == "defineundef" +# rules wrapped in .IFs break Win9X build (we end up with unbalanced []s unless +# unless the .IF is true), so instead we use a .ELSE with the default perllib$(o) : perllib.c +.IF "$(USE_IMP_SYS)$(USE_OBJECT)" == "defineundef" $(CC) -c -I. $(CFLAGS_O) $(CXX_FLAG) $(OBJOUT_FLAG)$@ perllib.c +.ELSE + $(CC) -c -I. $(CFLAGS_O) $(OBJOUT_FLAG)$@ perllib.c .ENDIF # 1. we don't want to rebuild miniperl.exe when config.h changes @@ -1061,10 +1016,10 @@ $(PERLDLL): perldll.def $(PERLDLL_OBJ) $(PERLDLL_RES) $(LINK32) -mdll -o $@ -Wl,--base-file -Wl,perl.base $(BLINK_FLAGS) \ $(mktmp $(LKPRE) $(PERLDLL_OBJ:s,\,\\) $(LIBFILES) $(LKPOST)) dlltool --output-lib $(PERLIMPLIB) \ - --dllname $(PERLDLL:b).dll \ - --def perldll.def \ - --base-file perl.base \ - --output-exp perl.exp + --dllname $(PERLDLL:b).dll \ + --def perldll.def \ + --base-file perl.base \ + --output-exp perl.exp $(LINK32) -mdll -o $@ $(BLINK_FLAGS) \ $(mktmp $(LKPRE) $(PERLDLL_OBJ:s,\,\\) $(LIBFILES) \ perl.exp $(LKPOST)) @@ -1119,7 +1074,7 @@ $(PERLEXE): $(PERLDLL) $(CONFIGPM) $(PERLEXE_OBJ) $(PERLEXE_RES) $(@:s,\,\\),\n \ $(PERLIMPLIB) $(LIBFILES)\n) .ELIF "$(CCTYPE)" == "GCC" - $(LINK32) -nostdlib -o $@ $(BLINK_FLAGS) \ + $(LINK32) -mconsole -o $@ $(BLINK_FLAGS) \ $(PERLEXE_OBJ) $(PERLIMPLIB) $(LIBFILES) .ELSE $(LINK32) -subsystem:console -out:$@ $(BLINK_FLAGS) $(LIBFILES) \ diff --git a/win32/oldnames.def b/win32/oldnames.def deleted file mode 100644 index a6ffd34..0000000 --- a/win32/oldnames.def +++ /dev/null @@ -1,115 +0,0 @@ -; -; oldnames.def -; -; oldnames versions of MSVCRT/PerlCRT functions for GCC/Mingw32 -; -; This file is taken from the Mingw32 distribution -; Created by Colin Peters for Mingw32 -; -; Added to Perl5 distrbution by Benjamin Stuhl - -EXPORTS -access -beep -cabs -chdir -chmod -chsize -close -creat -cwait -dup -dup2 -ecvt -eof -execl -execle -execlp -execlpe -execv -execve -execvp -execvpe -fcvt -fdopen -fgetchar -fgetwchar -filelength -fileno -fputchar -fputwchar -fstat -ftime -gcvt -getch -getche -getcwd -getpid -getw -heapwalk -hypot -isatty -itoa -j0 -j1 -jn -kbhit -lseek -ltoa -memccpy -memicmp -mkdir -mktemp -open -pclose -popen -putch -putenv -putw -read -rmdir -searchenv -seterrormode -setmode -sleep -sopen -spawnl -spawnle -spawnlp -spawnlpe -spawnv -spawnve -spawnvp -spawnvpe -stat -strcmpi -strdup -stricmp -stricoll -strlwr -strnicmp -strnset -strrev -strset -strupr -swab -tell -tempnam -tzset -umask -ungetch -unlink -utime -wcsdup -wcsicmp -wcsicoll -wcslwr -wcsnicmp -wcsnset -wcsrev -wcsset -wcsupr -write -y0 -y1 -yn diff --git a/win32/perlhost.h b/win32/perlhost.h index 01ff73d..15f03c6 100644 --- a/win32/perlhost.h +++ b/win32/perlhost.h @@ -1668,7 +1668,7 @@ win32_start_child(LPVOID arg) { dJMPENV; - volatile oldscope = PL_scopestack_ix; + volatile int oldscope = PL_scopestack_ix; restart: JMPENV_PUSH(status); diff --git a/win32/perllib.c b/win32/perllib.c index 1b8516c..9ccf5a0 100644 --- a/win32/perllib.c +++ b/win32/perllib.c @@ -404,7 +404,7 @@ DllMain(HANDLE hModule, /* DLL module handle */ _fmode = O_BINARY; #endif g_TlsAllocIndex = TlsAlloc(); - DisableThreadLibraryCalls(hModule); + DisableThreadLibraryCalls((HMODULE)hModule); w32_perldll_handle = hModule; break; diff --git a/win32/runperl.c b/win32/runperl.c index 8e6b249..85fd831 100644 --- a/win32/runperl.c +++ b/win32/runperl.c @@ -2,10 +2,6 @@ #include "perl.h" #ifdef __GNUC__ -/* - * GNU C does not do __declspec() - */ -#define __declspec(foo) /* Mingw32 defaults to globing command line * This is inconsistent with other Win32 ports and diff --git a/win32/win32.c b/win32/win32.c index 4fcf6aa..ae22a60 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -15,6 +15,8 @@ #define Win32_Winsock #endif #include +#include +#include /* #include "config.h" */ diff --git a/win32/win32.h b/win32/win32.h index 50b4f19..c953f5b 100644 --- a/win32/win32.h +++ b/win32/win32.h @@ -9,7 +9,9 @@ #ifndef _INC_WIN32_PERL5 #define _INC_WIN32_PERL5 -#define _WIN32_WINNT 0x0400 /* needed for TryEnterCriticalSection() etc. */ +#ifndef _WIN32_WINNT +# define _WIN32_WINNT 0x0400 /* needed for TryEnterCriticalSection() etc. */ +#endif #if defined(PERL_OBJECT) || defined(PERL_IMPLICIT_SYS) || defined(PERL_CAPI) # define DYNAMIC_ENV_FETCH @@ -35,18 +37,6 @@ # define __int64 long long # endif # define Win32_Winsock -/* GCC does not do __declspec() - render it a nop - * and turn on options to avoid importing data - */ -#ifndef __declspec -# define __declspec(x) -#endif -# ifndef PERL_OBJECT -# define PERL_GLOBAL_STRUCT -# ifndef MULTIPLICITY -# define MULTIPLICITY -# endif -# endif #endif /* Define DllExport akin to perl's EXT, @@ -55,6 +45,8 @@ * otherwise import it. */ +/* now even GCC supports __declspec() */ + #if defined(PERL_OBJECT) #define DllExport #else @@ -251,9 +243,6 @@ typedef long gid_t; #define flushall _flushall #define fcloseall _fcloseall -#undef __attribute__ -#define __attribute__(x) - #ifndef CP_UTF8 # define CP_UTF8 65001 #endif