Skip to content

Commit 251dfce

Browse files
committed
BSON Ext: Use winsock2.h on windows, not inet.h
1 parent adf4b9e commit 251dfce

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

ext/cbson/cbson.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,13 @@
2222

2323
#include "ruby.h"
2424
#include "version.h"
25-
#include <arpa/inet.h>
25+
26+
#if (defined(_WIN16) || defined(_WIN32) || defined(_WIN64)) && !defined(__WINDOWS__)
27+
# define __WINDOWS__
28+
# include <winsock2.h>
29+
#else
30+
# include <arpa/inet.h>
31+
#endif
2632

2733
/* Ensure compatibility with early releases of Ruby 1.8.5 */
2834
#ifndef RSTRING_PTR

0 commit comments

Comments
 (0)