1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
|
Description: Fix compilation issue on kFreeBSD and HURD
Author: Mathieu Malaterre <malat@debian.org>
Forwarded: no
Index: socket++-1.12.13/socket++/local.h
===================================================================
--- socket++-1.12.13.orig/socket++/local.h 2013-12-13 09:11:52.000000000 +0100
+++ socket++-1.12.13/socket++/local.h 2013-12-13 09:11:55.000000000 +0100
@@ -81,17 +81,19 @@
#if !defined (__linux__) // LN
extern "C" int shutdown (int, int); // they have forgotten this
+#else
+# include <arpa/inet.h>
#endif
// <arpa/inet.h> does not have a prototype for inet_addr () and gethostname()
-extern "C" unsigned long inet_addr (const char*);
+//extern "C" unsigned long inet_addr (const char*);
// arpa/in.h does not provide a protype for the following
-extern "C" char* inet_ntoa (in_addr ina);
+//extern "C" char* inet_ntoa (in_addr ina);
#if !(defined (__linux__) || defined(__FreeBSD__))
- extern "C" int gethostname (char* hostname, int len);
-#if !(defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__bsdi__) || defined(__APPLE__))
+// extern "C" int gethostname (char* hostname, int len);
+#if !(defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__bsdi__) || defined(__APPLE__))
extern char* SYS_SIGLIST [];
#endif
#endif
Index: socket++-1.12.13/socket++/sockstream.cpp
===================================================================
--- socket++-1.12.13.orig/socket++/sockstream.cpp 2013-12-13 09:11:52.000000000 +0100
+++ socket++-1.12.13/socket++/sockstream.cpp 2013-12-13 09:11:55.000000000 +0100
@@ -232,7 +232,7 @@
case EWOULDBLOCK:
// On FreeBSD (and probably on Linux too)
// EAGAIN has the same value as EWOULDBLOCK
-#if !defined(__linux__) && !(defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__bsdi__) || defined(__APPLE__)) // LN
+#if defined(EAGAIN) && (EAGAIN != EWOULDBLOCK)
case EAGAIN:
#endif
return true;
Index: socket++-1.12.13/socket++/sockstream.h
===================================================================
--- socket++-1.12.13.orig/socket++/sockstream.h 2011-12-27 12:26:23.000000000 +0100
+++ socket++-1.12.13/socket++/sockstream.h 2013-12-13 09:11:55.000000000 +0100
@@ -37,7 +37,7 @@
# pragma comment(lib, "Wininet")
#endif
-#ifdef __linux__
+#if defined(__linux__) /*|| defined(__FreeBSD_kernel__)*/
# define MSG_MAXIOVLEN 16
#endif // __linux__
@@ -137,7 +137,7 @@
msg_peek = MSG_PEEK,
msg_dontroute = MSG_DONTROUTE,
-#if !(defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__bsdi__) || defined(__APPLE__))
+#if !(defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__bsdi__) || defined(__APPLE__))
msg_maxiovlen = MSG_MAXIOVLEN
#endif
};
|