summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2012-12-14 19:39:21 +0100
committerYang Tse <yangsita@gmail.com>2012-12-14 19:39:21 +0100
commit4ed0fc2d448d70dd079a311fa9804d504968942f (patch)
tree84e3c783615348831b2831e054591efa427b087a
parent0c677f578e8be6050c976f3923b833fbe8fc9cfb (diff)
downloadc-ares-4ed0fc2d448d70dd079a311fa9804d504968942f.tar.gz
c-ares-4ed0fc2d448d70dd079a311fa9804d504968942f.tar.bz2
c-ares-4ed0fc2d448d70dd079a311fa9804d504968942f.zip
setup_once.h: HP-UX <sys/socket.h> issue workaround
Issue: When building a 32bit target with large file support HP-UX <sys/socket.h> header file may simultaneously provide two different sets of declarations for sendfile and sendpath functions, one with static and another with external linkage. Given that we do not use mentioned functions we really don't care which linkage is the appropriate one, but on the other hand, the double declaration emmits warnings when using the HP-UX compiler and errors when using modern gcc versions resulting in fatal compilation errors. Mentioned issue is now fixed as long as we don't use sendfile nor sendpath functions.
-rw-r--r--setup_once.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/setup_once.h b/setup_once.h
index 3dad534..5822b49 100644
--- a/setup_once.h
+++ b/setup_once.h
@@ -80,10 +80,30 @@
#include <unistd.h>
#endif
+#ifdef __hpux
+# if !defined(_XOPEN_SOURCE_EXTENDED) || defined(_KERNEL)
+# ifdef _APP32_64BIT_OFF_T
+# define OLD_APP32_64BIT_OFF_T _APP32_64BIT_OFF_T
+# undef _APP32_64BIT_OFF_T
+# else
+# undef OLD_APP32_64BIT_OFF_T
+# endif
+# endif
+#endif
+
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
+#ifdef __hpux
+# if !defined(_XOPEN_SOURCE_EXTENDED) || defined(_KERNEL)
+# ifdef OLD_APP32_64BIT_OFF_T
+# define _APP32_64BIT_OFF_T OLD_APP32_64BIT_OFF_T
+# undef OLD_APP32_64BIT_OFF_T
+# endif
+# endif
+#endif
+
/*
* Definition of timeval struct for platforms that don't have it.