rbb 99/11/11 07:10:06
Modified:src/lib/apr APRDesign
src/lib/apr/include apr_win.h
Log:
Fix the APR build process on Windows. I am also updating the APRDesign
document to specifically discuss coding for Windows, and what must be
done to keep APR on Windows working.
Revision ChangesPath
1.4 +21 -0 apache-2.0/src/lib/apr/APRDesign
Index: APRDesign
===
RCS file: /home/cvs/apache-2.0/src/lib/apr/APRDesign,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- APRDesign 1999/10/21 11:14:49 1.3
+++ APRDesign 1999/11/11 15:10:05 1.4
@@ -19,6 +19,27 @@
This document will discuss the structure of APR, and how best to contribute
code to the effort.
+APR On Windows
+
+I am putting this at the top because it is an important topic. APR on
Windows
+is different from APR on all other systems, because it doesn't use autoconf.
+As far as I know there is no autoconf for Windows, so we don't have much of a
+choice in this. Because autoconf is generating our apr_config.h file we need
+to take care when adding macros to it. There is an apr_win.h file which
replaces
+apr_config.h on Windows, and it needs to be kept up to date.
+
+!!!*** If you add code to acconfig.h or tests to configure.in or aclocal.m4,
+please give some thought to whether or not Windows needs this
addition
+as well. A general rule of thumb, is that if it is a feature macro,
+such as APR_HAS_THREADS, Windows needs it. If the definition is
going
+to be used in a public APR header file, such as apr_general.h,
Windows
+needs it.
+
+The only time it is safe to add a macro or test without also adding
+the macro to apr_win.h, is if the macro tells APR how to build. For
+example, a test for a header file does not need to be added to
Windows.
+***!!!
+
APR Features
One of the goals of APR is to provide a common set of features across all
1.6 +34 -15apache-2.0/src/lib/apr/include/apr_win.h
Index: apr_win.h
===
RCS file: /home/cvs/apache-2.0/src/lib/apr/include/apr_win.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- apr_win.h 1999/11/08 18:54:00 1.5
+++ apr_win.h 1999/11/11 15:10:06 1.6
@@ -80,12 +80,6 @@
*/
#define HAVE_CONIO_H 1
-/* struct iovec is needed to emulate Unix writev */
-struct iovec {
-char* iov_base;
-int iov_len;
-};
-
typedef enum {APR_WIN_NT, APR_WIN_95, APR_WIN_98} ap_oslevel_e;
#define SIGHUP 1
@@ -120,27 +114,52 @@
#define SIGWINCH 30
#define SIGIO 31
-typedef _off_t off_t;
-typedef int pid_t;
-typedef void (Sigfunc)(int);
-
#define __attribute__(__x)
-#define SIZEOF_SHORT 2
-#define SIZEOF_INT 4
-#define SIZEOF_LONGLONG 8
-
#define API_EXPORT(x)x
#define API_EXPORT_NONSTD(x) x
#define API_THREAD_FUNC __stdcall
#define API_VAR_IMPORT extern _declspec(dllimport)
+/* APR COMPATABILITY FUNCTIONS
+ * This section should be used to define functions and
+ * macros which are need to make Windows features look
+ * like POSIX features.
+ */
+/* struct iovec is needed to emulate Unix writev */
+struct iovec {
+char* iov_base;
+int iov_len;
+};
+
+typedef _off_t off_t;
+typedef int ssize_t;
+typedef int pid_t;
+typedef void (Sigfunc)(int);
+
#define strcasecmp(s1, s2) stricmp(s1, s2)
#define sleep(t) Sleep(t * 1000)
+
+/* APR FEATURE MACROS.
+ * This section should be used to define feature macros
+ * that the windows port needs.
+ */
+#define APR_HAS_THREADS1
+
+#define SIZEOF_SHORT 2
+#define SIZEOF_INT 4
+#define SIZEOF_LONGLONG8
+#define SIZEOF_CHAR1
+#define SIZEOF_SSIZE_T SIZEOF_INT
+
+/* APR WINDOWS-ONLY FUNCTIONS
+ * This section should define those functions which are
+ * only found in the windows version of APR.
+ */
+
time_t WinTimeToUnixTime(FILETIME *);
unsigned __stdcall SignalHandling(void *);
-
int thread_ready(void);
#endif /*APR_WIN_H*/