summaryrefslogtreecommitdiff
path: root/ext/socket/addrinfo.h
diff options
context:
space:
mode:
Diffstat (limited to 'ext/socket/addrinfo.h')
-rw-r--r--ext/socket/addrinfo.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/ext/socket/addrinfo.h b/ext/socket/addrinfo.h
index d4e2091d69..6ea4a823f6 100644
--- a/ext/socket/addrinfo.h
+++ b/ext/socket/addrinfo.h
@@ -154,4 +154,11 @@ extern void freehostent __P((struct hostent *));
extern void freeaddrent __P((struct addrinfo *));
extern char *gai_strerror __P((int));
+/* In case there is no definition of offsetof() provided - though any proper
+Standard C system should have one. */
+
+#ifndef offsetof
+#define offsetof(p_type,field) ((size_t)&(((p_type *)0)->field))
+#endif
+
#endif