Skip to content

Commit

Permalink
#2015 Allow compilation on MSVC by avoiding winsocket redefinitions
Browse files Browse the repository at this point in the history
Note: jaro_winkler is a native gem dependency of rubocop that currently doesn't supports C89 (MSVC)
  • Loading branch information
jmarrec committed Mar 30, 2020
1 parent e587654 commit 59d78e0
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions ext/nokogiri/nokogiri.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
#ifndef NOKOGIRI_NATIVE
#define NOKOGIRI_NATIVE

#if _MSC_VER
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif /* WIN32_LEAN_AND_MEAN */
#ifndef WIN32
#define WIN32
#endif /* WIN32 */
#include <winsock2.h>
#include <ws2tcpip.h>
#include <windows.h>
#endif

#include <stdlib.h>
#include <string.h>
#include <assert.h>
Expand Down

0 comments on commit 59d78e0

Please sign in to comment.