You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by "William A. Rowe, Jr." <wr...@lnd.com> on 2000/06/22 04:09:27 UTC

Win32 1.3.13 patches for the free Win32 compiler

Win32 folks... (esp bcc users!)

Based on research thus far, online are the changes to the win32 
that I've uncovered preparing to implement borland's bcc 5.5 
build (free compiler).  Some are fixes to real issues today (the
type of mode_t and the os_spawnle export declaration, for example)
that I wouldn't have otherwise noted.

I'm not bothering with the .dsp and .mak changes, which are simply
the proper list of link libs and the appropriate include paths so
the os.h is locatable (therefore we have the first patch.)

The latest iteration of the converter is also attached.

The biggest issues will be compile and linkage flags, and what
they aught to be for the most reliable bcc Apache build.  I'm
ready to throw it at someone at Borland, given they stand to
benefit from the notariety/publicity.  Frankly, I don't have time
to waste digging out the flags for coff vs omf formats etc...
Two things I'm not inviting without ample justification are any
discussion of the API_EXPORT* tags or new custom .def's listing
all the entry points yet again.  Let's make this as straight-line
as we possibly can (within reason, of course.)

Comments?


Index: include/ap_config.h
===================================================================
RCS file: /home/cvs/apache-1.3/src/include/ap_config.h,v
retrieving revision 1.289
diff -u -r1.289 ap_config.h
--- include/ap_config.h	2000/06/19 20:36:34	1.289
+++ include/ap_config.h	2000/06/22 01:56:44
@@ -110,11 +110,7 @@
 #define ENUM_BITFIELD(e,n,w)  e n : w
 #endif
 
-#ifdef WIN32
-#include "../os/win32/os.h"
-#else
 #include "os.h"
-#endif
 
 /* Define one of these according to your system. */
 #if defined(MINT)
Index: os/win32/os.h
===================================================================
RCS file: /home/cvs/apache-1.3/src/os/win32/os.h,v
retrieving revision 1.31
diff -u -r1.31 os.h
--- os/win32/os.h	1999/09/13 13:32:41	1.31
+++ os/win32/os.h	2000/06/22 01:44:47
@@ -109,7 +109,10 @@
 typedef int uid_t;
 typedef int gid_t;
 typedef int pid_t;
-typedef int mode_t;
+#ifdef _MSC_VER
+/* modified to match declaration in sys/stat.h */
+typedef unsigned short mode_t;
+#endif
 typedef char * caddr_t;
 
 /*
@@ -118,34 +121,39 @@
 */
 
 #ifdef SHARED_MODULE
-# define API_VAR_EXPORT		__declspec(dllimport)
-# define API_EXPORT(type)    __declspec(dllimport) type __stdcall
-# define API_EXPORT_NONSTD(type)    __declspec(dllimport) type
+#define API_VAR_EXPORT          __declspec(dllimport)
+#define API_EXPORT(type)        __declspec(dllimport) type __stdcall
+#define API_EXPORT_NONSTD(type) __declspec(dllimport) type __cdecl
 #else
-# define API_VAR_EXPORT		__declspec(dllexport)
-# define API_EXPORT(type)    __declspec(dllexport) type __stdcall
-# define API_EXPORT_NONSTD(type)    __declspec(dllexport) type
+#define API_VAR_EXPORT          __declspec(dllexport)
+#define API_EXPORT(type)        __declspec(dllexport) type __stdcall
+#define API_EXPORT_NONSTD(type) __declspec(dllexport) type __cdecl
 #endif
 #define MODULE_VAR_EXPORT   __declspec(dllexport)
 
 #define strcasecmp(s1, s2) stricmp(s1, s2)
 #define strncasecmp(s1, s2, n) strnicmp(s1, s2, n)
 #define lstat(x, y) stat(x, y)
+#ifndef S_ISLNK
 #define S_ISLNK(m) (0)
-#define S_ISREG(m) ((m & _S_IFREG) == _S_IFREG)
-#ifndef S_ISDIR
-#define S_ISDIR(m) (((m) & S_IFDIR) == S_IFDIR)
 #endif
 #ifndef S_ISREG
-#define S_ISREG(m)      (((m)&(S_IFREG)) == (S_IFREG))
+#define S_ISREG(m) ((m & _S_IFREG) == _S_IFREG)
 #endif
+#ifndef S_ISDIR
+#define S_ISDIR(m) (((m) & _S_IFDIR) == _S_IFDIR)
+#endif
 #define STDIN_FILENO  0
 #define STDOUT_FILENO 1
 #define STDERR_FILENO 2
 #define JMP_BUF jmp_buf
 #define sleep(t) Sleep(t*1000)
+#ifndef O_CREAT
 #define O_CREAT _O_CREAT
+#endif
+#ifndef O_RDWR
 #define O_RDWR _O_RDWR
+#endif
 #define SIGPIPE 17
 /* Seems Windows is not a subgenius */
 #define NO_SLACK
@@ -175,7 +183,7 @@
 API_EXPORT(int) os_spawnve(int mode,const char *cmdname,const char *const *argv,const char *const *envp);
 #define _spawnle			    os_spawnle
 #define spawnle				    os_spawnle
-API_EXPORT(int) os_spawnle(int mode,const char *cmdname,...);
+API_EXPORT_NONSTD(int) os_spawnle(int mode,const char *cmdname,...);
 
 /* OS-dependent filename routines in util_win32.c */
 
Index: os/win32/util_win32.c
===================================================================
RCS file: /home/cvs/apache-1.3/src/os/win32/util_win32.c,v
retrieving revision 1.34
diff -u -r1.34 util_win32.c
--- os/win32/util_win32.c	2000/06/02 16:30:27	1.34
+++ os/win32/util_win32.c	2000/06/22 01:44:49
@@ -424,7 +424,7 @@
     return _spawnve(mode, szCmd, aszArgs, envp);
 }
 
-API_EXPORT(int) os_spawnle(int mode, const char *cmdname, ...)
+API_EXPORT_NONSTD(int) os_spawnle(int mode, const char *cmdname, ...)
 {
     int n;
     va_list vlist;