You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by st...@locus.apache.org on 2000/04/20 19:21:38 UTC
cvs commit: apache-2.0/src/lib/apr/misc/win32 misc.h
stoddard 00/04/20 10:21:35
Modified: src/lib/apr/file_io/win32 filestat.c open.c pipe.c
src/lib/apr/include apr_config.hw
src/lib/apr/misc/win32 misc.h
Log:
Win32: Fix compile break caused by the recent ap_strerror patch.
Move APR dependent code out of ap_config.hw and into misc/win32/misc.h.
Include misc.h where needed.
Revision Changes Path
1.16 +1 -0 apache-2.0/src/lib/apr/file_io/win32/filestat.c
Index: filestat.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/lib/apr/file_io/win32/filestat.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- filestat.c 2000/04/14 15:58:23 1.15
+++ filestat.c 2000/04/20 17:21:31 1.16
@@ -60,6 +60,7 @@
#include "apr_time.h"
#include <sys/stat.h>
#include "atime.h"
+#include "misc.h"
#define S_ISLNK(m) (0)
#define S_ISREG(m) (((m) & (S_IFMT)) == S_IFREG)
1.34 +1 -0 apache-2.0/src/lib/apr/file_io/win32/open.c
Index: open.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/lib/apr/file_io/win32/open.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -r1.33 -r1.34
--- open.c 2000/04/19 21:17:27 1.33
+++ open.c 2000/04/20 17:21:31 1.34
@@ -62,6 +62,7 @@
#include <winbase.h>
#include <string.h>
#include <sys/stat.h>
+#include "misc.h"
ap_status_t file_cleanup(void *thefile)
{
1.14 +1 -0 apache-2.0/src/lib/apr/file_io/win32/pipe.c
Index: pipe.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/lib/apr/file_io/win32/pipe.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- pipe.c 2000/04/18 13:57:29 1.13
+++ pipe.c 2000/04/20 17:21:31 1.14
@@ -61,6 +61,7 @@
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
+#include "misc.h"
ap_status_t ap_set_pipe_timeout(ap_file_t *thepipe, ap_int32_t timeout)
{
1.10 +6 -73 apache-2.0/src/lib/apr/include/apr_config.hw
Index: apr_config.hw
===================================================================
RCS file: /home/cvs/apache-2.0/src/lib/apr/include/apr_config.hw,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- apr_config.hw 2000/04/18 09:45:24 1.9
+++ apr_config.hw 2000/04/20 17:21:33 1.10
@@ -53,8 +53,13 @@
*/
/*
- * Note: This is the windows specific autoconf like config file (apr_config.h)
+ * Note:
+ * This is the windows specific autoconf like config file
+ * which is used to generate apr_config.h at build time.
+ * Do not put any code into this file which depends on
+ * APR include files.
*/
+
#ifdef WIN32
#ifndef APR_CONFIG_H
@@ -77,7 +82,6 @@
#include <stddef.h>
#include <stdio.h>
#include <time.h>
-#include "apr_errno.h"
#define HAVE_SENDFILE 1
@@ -147,77 +151,6 @@
#define SIZEOF_CHAR 1
#define SIZEOF_SSIZE_T SIZEOF_INT
-
-/* Platform specific designation of run time os version.
- * Gaps allow for specific service pack levels that
- * export new kernel or winsock functions or behavior.
- */
-typedef enum {
- APR_WIN_95 = 0,
- APR_WIN_98 = 4,
- APR_WIN_NT = 8,
- APR_WIN_NT_4 = 12,
- APR_WIN_NT_4_SP2 = 14,
- APR_WIN_NT_4_SP3 = 15,
- APR_WIN_NT_4_SP4 = 16,
- APR_WIN_NT_4_SP6 = 18,
- APR_WIN_2000 = 24
-} ap_oslevel_e;
-
-
-typedef enum {
- DLL_WINBASEAPI = 0, // kernel32 From WinBase.h
- DLL_WINADVAPI = 1, // advapi32 From WinBase.h
- DLL_WINSOCKAPI = 2, // mswsock From WinSock.h
- DLL_WINSOCK2API = 3, // ws2_32 From WinSock2.h
- DLL_defined = 4 // must define as last idx_ + 1
-} ap_dlltoken_e;
-
-FARPROC LoadLateDllFunc(ap_dlltoken_e fnLib, char *fnName, int ordinal);
-
-/* The LateFunctionName call WILL fault if the function cannot be loaded */
-
-#define DECLARE_LATE_DLL_FUNC(lib, rettype, calltype, fn, ord, args, names) \
- typedef rettype (calltype *fpt##fn) args; \
- static fpt##fn pfn##fn = NULL; \
- __inline rettype Late##fn args \
- { if (!pfn##fn) \
- pfn##fn = (fpt##fn) LoadLateDllFunc(lib, #fn, ord); \
- return (*(pfn##fn)) names; }; \
-
-/* Provide late bound declarations of every API function missing from
- * one or more supported releases of the Win32 API
- *
- * lib is the enumerated token from ap_dlltoken_e, and must correspond
- * to the string table entry in start.c used by the LoadLateDllFunc().
- * Token names (attempt to) follow Windows.h declarations prefixed by DLL_
- * in order to facilitate comparison. Use the exact declaration syntax
- * and names from Windows.h to prevent ambigutity and bugs.
- *
- * rettype and calltype follow the original declaration in Windows.h
- * fn is the true function name - beware Ansi/Unicode #defined macros
- * ord is the ordinal within the library, use 0 if it varies between versions
- * args is the parameter list following the original declaration, in parens
- * names is the parameter list sans data types, enclosed in parens
- *
- * #undef/re#define the Ansi/Unicode generic name to abate confusion
- * In the case of non-text functions, simply #define the original name
- */
-
-DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, GetFileAttributesExA, 0, (
- IN LPCSTR lpFileName,
- IN GET_FILEEX_INFO_LEVELS fInfoLevelId,
- OUT LPVOID lpFileInformation),
- (lpFileName, fInfoLevelId, lpFileInformation));
-#undef GetFileAttributesEx
-#define GetFileAttributesEx LateGetFileAttributesExA
-
-
-/* APR WINDOWS-ONLY FUNCTIONS
- * This section should define those functions which are
- * only found in the windows version of APR.
- */
-ap_status_t ap_get_oslevel(struct ap_pool_t *, ap_oslevel_e *);
unsigned __stdcall SignalHandling(void *);
int thread_ready(void);
1.11 +65 -0 apache-2.0/src/lib/apr/misc/win32/misc.h
Index: misc.h
===================================================================
RCS file: /home/cvs/apache-2.0/src/lib/apr/misc/win32/misc.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- misc.h 2000/04/14 16:50:26 1.10
+++ misc.h 2000/04/20 17:21:34 1.11
@@ -69,6 +69,71 @@
#define WSAHighByte 2
#define WSALowByte 0
+/* Platform specific designation of run time os version.
+ * Gaps allow for specific service pack levels that
+ * export new kernel or winsock functions or behavior.
+ */
+typedef enum {
+ APR_WIN_95 = 0,
+ APR_WIN_98 = 4,
+ APR_WIN_NT = 8,
+ APR_WIN_NT_4 = 12,
+ APR_WIN_NT_4_SP2 = 14,
+ APR_WIN_NT_4_SP3 = 15,
+ APR_WIN_NT_4_SP4 = 16,
+ APR_WIN_NT_4_SP6 = 18,
+ APR_WIN_2000 = 24
+} ap_oslevel_e;
+
+
+typedef enum {
+ DLL_WINBASEAPI = 0, // kernel32 From WinBase.h
+ DLL_WINADVAPI = 1, // advapi32 From WinBase.h
+ DLL_WINSOCKAPI = 2, // mswsock From WinSock.h
+ DLL_WINSOCK2API = 3, // ws2_32 From WinSock2.h
+ DLL_defined = 4 // must define as last idx_ + 1
+} ap_dlltoken_e;
+
+FARPROC LoadLateDllFunc(ap_dlltoken_e fnLib, char *fnName, int ordinal);
+
+/* The LateFunctionName call WILL fault if the function cannot be loaded */
+
+#define DECLARE_LATE_DLL_FUNC(lib, rettype, calltype, fn, ord, args, names) \
+ typedef rettype (calltype *fpt##fn) args; \
+ static fpt##fn pfn##fn = NULL; \
+ __inline rettype Late##fn args \
+ { if (!pfn##fn) \
+ pfn##fn = (fpt##fn) LoadLateDllFunc(lib, #fn, ord); \
+ return (*(pfn##fn)) names; }; \
+
+/* Provide late bound declarations of every API function missing from
+ * one or more supported releases of the Win32 API
+ *
+ * lib is the enumerated token from ap_dlltoken_e, and must correspond
+ * to the string table entry in start.c used by the LoadLateDllFunc().
+ * Token names (attempt to) follow Windows.h declarations prefixed by DLL_
+ * in order to facilitate comparison. Use the exact declaration syntax
+ * and names from Windows.h to prevent ambigutity and bugs.
+ *
+ * rettype and calltype follow the original declaration in Windows.h
+ * fn is the true function name - beware Ansi/Unicode #defined macros
+ * ord is the ordinal within the library, use 0 if it varies between versions
+ * args is the parameter list following the original declaration, in parens
+ * names is the parameter list sans data types, enclosed in parens
+ *
+ * #undef/re#define the Ansi/Unicode generic name to abate confusion
+ * In the case of non-text functions, simply #define the original name
+ */
+
+DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, GetFileAttributesExA, 0, (
+ IN LPCSTR lpFileName,
+ IN GET_FILEEX_INFO_LEVELS fInfoLevelId,
+ OUT LPVOID lpFileInformation),
+ (lpFileName, fInfoLevelId, lpFileInformation));
+#undef GetFileAttributesEx
+#define GetFileAttributesEx LateGetFileAttributesExA
+
+ap_status_t ap_get_oslevel(struct ap_pool_t *, ap_oslevel_e *);
#endif /* ! MISC_H */