summaryrefslogtreecommitdiff
path: root/ext/socket
diff options
context:
space:
mode:
Diffstat (limited to 'ext/socket')
-rw-r--r--ext/socket/getaddrinfo.c2
-rw-r--r--ext/socket/getnameinfo.c2
-rw-r--r--ext/socket/rubysocket.h3
3 files changed, 5 insertions, 2 deletions
diff --git a/ext/socket/getaddrinfo.c b/ext/socket/getaddrinfo.c
index 6d6d11fa8fa..dcd1cea0df9 100644
--- a/ext/socket/getaddrinfo.c
+++ b/ext/socket/getaddrinfo.c
@@ -45,7 +45,7 @@
#include <sys/types.h>
#ifndef _WIN32
#include <sys/param.h>
-#if defined(__BEOS__) && !defined(__HAIKU__) && !defined(BONE)
+#if defined(__BEOS__) && !defined(BONE)
# include <net/socket.h>
#else
# include <sys/socket.h>
diff --git a/ext/socket/getnameinfo.c b/ext/socket/getnameinfo.c
index d54a7c8c0d9..37f926f7937 100644
--- a/ext/socket/getnameinfo.c
+++ b/ext/socket/getnameinfo.c
@@ -41,7 +41,7 @@
#include <stdio.h>
#include <sys/types.h>
#ifndef _WIN32
-#if defined(__BEOS__) && !defined(__HAIKU__) && !defined(BONE)
+#if defined(__BEOS__) && !defined(BONE)
# include <net/socket.h>
#else
# include <sys/socket.h>
diff --git a/ext/socket/rubysocket.h b/ext/socket/rubysocket.h
index 22a61e3777a..601667d59de 100644
--- a/ext/socket/rubysocket.h
+++ b/ext/socket/rubysocket.h
@@ -80,6 +80,9 @@
#endif
#ifdef HAVE_IFADDRS_H
+# ifdef __HAIKU__
+# define _BSD_SOURCE
+# endif
# include <ifaddrs.h>
#endif
#ifdef HAVE_SYS_IOCTL_H