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)

I'm using conan-provided system dependencies since package deps won't work
  • Loading branch information
jmarrec committed Mar 30, 2020
1 parent e587654 commit 28aca9b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ source "https://rubygems.org/"

gem "mini_portile2", "~>2.5.0"

gem 'jaro_winkler', '= 1.5.4', :github => 'jmarrec/jaro_winkler', :ref => 'f1ca425fdef06603e5c65b09c5b681f805e1e297'
gem "concourse", "~>0.30", :group => [:development, :test]
gem "hoe", "~>3.22", ">=3.22.1", :group => [:development, :test]
gem "hoe-bundler", "~>1.2", :group => [:development, :test]
Expand Down
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 28aca9b

Please sign in to comment.