summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortrawick <trawick@13f79535-47bb-0310-9956-ffa450edef68>2015-10-09 13:05:19 +0000
committertrawick <trawick@13f79535-47bb-0310-9956-ffa450edef68>2015-10-09 13:05:19 +0000
commit17f24f9654359d590226acb93aa12c4a106d63e8 (patch)
treeb3a758b45237ec26892c1615ff3bffd7fdc67f17
parentbc1bbe6fd78be5f41d0d63141d74ebe0ba1b97ab (diff)
downloadlibapr-17f24f9654359d590226acb93aa12c4a106d63e8.tar.gz
Merge r1707712 from 1.6.x branch:
modest apr.h improvements for Windows, from various trunk commits * Ignore certain warnings with MSVC. * Align whitespace and improve some comments * Conditionally include additional header files as on Unix (none of these will be included without modifying defines) (The APR_HAVE_SOCKADDR_UN change to apr.hwc is not appropriate for this branch.) PR: this is tiny help for 58476 git-svn-id: http://svn.apache.org/repos/asf/apr/apr/branches/1.5.x@1707717 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--include/apr.hw39
-rw-r--r--include/apr.hwc39
2 files changed, 60 insertions, 18 deletions
diff --git a/include/apr.hw b/include/apr.hw
index a75bc6029..095d89910 100644
--- a/include/apr.hw
+++ b/include/apr.hw
@@ -25,7 +25,7 @@
* And please, make an effort to stub apr.hnw and apr.h.in in the process.
*
* This is the Win32 specific version of apr.h. It is copied from
- * apr.hw by the apr.dsp and libapr.dsp projects.
+ * apr.hw by the apr.dsp and libapr.dsp projects.
*/
/**
@@ -60,7 +60,9 @@
* C4244: int to char/short - precision loss
* C4514: unreferenced inline function removed
*/
+#if defined(_MSC_VER)
#pragma warning(disable: 4100 4127 4163 4201 4514; once: 4057 4075 4244)
+#endif
/* Ignore Microsoft's interpretation of secure development
* and the POSIX string handling API
@@ -212,25 +214,42 @@
/** @} */
/** @} */
-/* We don't include our conditional headers within the doxyblocks
- * or the extern "C" namespace
+/* We don't include our conditional headers within the doxyblocks
+ * or the extern "C" namespace
*/
#if APR_HAVE_STDLIB_H
#include <stdlib.h>
#endif
+
#if APR_HAVE_STDIO_H
#include <stdio.h>
#endif
+
#if APR_HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
+
#if APR_HAVE_STDDEF_H
#include <stddef.h>
#endif
+
+#if APR_HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+
+#if APR_HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
+#if APR_HAVE_SYS_WAIT_H
+#include <sys/wait.h>
+#endif
+
#if APR_HAVE_TIME_H
#include <time.h>
#endif
+
#if APR_HAVE_PROCESS_H
#include <process.h>
#endif
@@ -261,12 +280,12 @@ extern "C" {
#define APR_USE_SHMEM_MMAP_ANON 0
#define APR_USE_SHMEM_BEOS 0
-#define APR_USE_FLOCK_SERIALIZE 0
+#define APR_USE_FLOCK_SERIALIZE 0
#define APR_USE_POSIXSEM_SERIALIZE 0
#define APR_USE_SYSVSEM_SERIALIZE 0
#define APR_USE_FCNTL_SERIALIZE 0
-#define APR_USE_PROC_PTHREAD_SERIALIZE 0
-#define APR_USE_PTHREAD_SERIALIZE 0
+#define APR_USE_PROC_PTHREAD_SERIALIZE 0
+#define APR_USE_PTHREAD_SERIALIZE 0
#define APR_HAS_FLOCK_SERIALIZE 0
#define APR_HAS_SYSVSEM_SERIALIZE 0
@@ -354,7 +373,7 @@ extern "C" {
/* Is the O_NONBLOCK flag inherited from listening sockets?
*/
-#define APR_O_NONBLOCK_INHERITED 1
+#define APR_O_NONBLOCK_INHERITED 1
/* Typedefs that APR needs. */
@@ -626,18 +645,20 @@ typedef int gid_t;
&& (*(const apr_uint32_t *)(const void *)(&(a)->s6_addr[8]) == ntohl(0x0000ffff)))
#endif
-#endif /* APR_HAS_IPV6 */
+#endif /* APR_HAVE_IPV6 */
#ifdef __cplusplus
}
#endif
-/* Done with badly written headers
+/* Done with badly written headers, leave 'deprecated CRT' undeprecated
*/
#if defined(_MSC_VER) && _MSC_VER >= 1200
#pragma warning(pop)
+#if _MSC_VER >= 1400
#pragma warning(disable: 4996)
#endif
+#endif
#endif /* WIN32 */
diff --git a/include/apr.hwc b/include/apr.hwc
index 057996295..614b8b979 100644
--- a/include/apr.hwc
+++ b/include/apr.hwc
@@ -25,7 +25,7 @@
* And please, make an effort to stub apr.hnw and apr.h.in in the process.
*
* This is the Win32 specific version of apr.h. It is copied from
- * apr.hw by the apr.dsp and libapr.dsp projects.
+ * apr.hw by the apr.dsp and libapr.dsp projects.
*/
/**
@@ -60,7 +60,9 @@
* C4244: int to char/short - precision loss
* C4514: unreferenced inline function removed
*/
+#if defined(_MSC_VER)
#pragma warning(disable: 4100 4127 4163 4201 4514; once: 4057 4075 4244)
+#endif
/* Ignore Microsoft's interpretation of secure development
* and the POSIX string handling API
@@ -209,25 +211,42 @@
/** @} */
/** @} */
-/* We don't include our conditional headers within the doxyblocks
- * or the extern "C" namespace
+/* We don't include our conditional headers within the doxyblocks
+ * or the extern "C" namespace
*/
#if APR_HAVE_STDLIB_H
#include <stdlib.h>
#endif
+
#if APR_HAVE_STDIO_H
#include <stdio.h>
#endif
+
#if APR_HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
+
#if APR_HAVE_STDDEF_H
#include <stddef.h>
#endif
+
+#if APR_HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+
+#if APR_HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
+#if APR_HAVE_SYS_WAIT_H
+#include <sys/wait.h>
+#endif
+
#if APR_HAVE_TIME_H
#include <time.h>
#endif
+
#if APR_HAVE_PROCESS_H
#include <process.h>
#endif
@@ -258,12 +277,12 @@ extern "C" {
#define APR_USE_SHMEM_MMAP_ANON 0
#define APR_USE_SHMEM_BEOS 0
-#define APR_USE_FLOCK_SERIALIZE 0
+#define APR_USE_FLOCK_SERIALIZE 0
#define APR_USE_POSIXSEM_SERIALIZE 0
#define APR_USE_SYSVSEM_SERIALIZE 0
#define APR_USE_FCNTL_SERIALIZE 0
-#define APR_USE_PROC_PTHREAD_SERIALIZE 0
-#define APR_USE_PTHREAD_SERIALIZE 0
+#define APR_USE_PROC_PTHREAD_SERIALIZE 0
+#define APR_USE_PTHREAD_SERIALIZE 0
#define APR_HAS_FLOCK_SERIALIZE 0
#define APR_HAS_SYSVSEM_SERIALIZE 0
@@ -351,7 +370,7 @@ extern "C" {
/* Is the O_NONBLOCK flag inherited from listening sockets?
*/
-#define APR_O_NONBLOCK_INHERITED 1
+#define APR_O_NONBLOCK_INHERITED 1
/* Typedefs that APR needs. */
@@ -623,18 +642,20 @@ typedef int gid_t;
&& (*(const apr_uint32_t *)(const void *)(&(a)->s6_addr[8]) == ntohl(0x0000ffff)))
#endif
-#endif /* APR_HAS_IPV6 */
+#endif /* APR_HAVE_IPV6 */
#ifdef __cplusplus
}
#endif
-/* Done with badly written headers
+/* Done with badly written headers, leave 'deprecated CRT' undeprecated
*/
#if defined(_MSC_VER) && _MSC_VER >= 1200
#pragma warning(pop)
+#if _MSC_VER >= 1400
#pragma warning(disable: 4996)
#endif
+#endif
#endif /* WIN32 */