Permalink
Browse files

Consistently adjust FD_SETSIZE on all extensions

Previously only `rubyeventmachine` FD were adjusted. Just to be consistent
all compiled extensions should be doing the same.
  • Loading branch information...
1 parent 5cfcce3 commit 923c8acb14f88103a58975b26c51760de4e960cc @luislavena luislavena committed Jun 28, 2012
Showing with 10 additions and 1 deletion.
  1. +10 −1 ext/fastfilereader/extconf.rb
@@ -26,6 +26,15 @@ def add_define(name)
add_define 'OS_UNIX'
end
+# Adjust number of file descriptors (FD) on Windows
+
+if RbConfig::CONFIG["host_os"] =~ /mingw/
+ found = RbConfig::CONFIG.values_at("CFLAGS", "CPPFLAGS").
+ any? { |v| v.include?("FD_SETSIZE") }
+
+ add_define "FD_SETSIZE=32767" unless found
+end
+
# Main platform invariances:
case RUBY_PLATFORM
@@ -91,4 +100,4 @@ def add_define(name)
CONFIG['LDSHARED'] = "$(CXX) -shared"
end
-create_makefile "fastfilereaderext"
+create_makefile "fastfilereaderext"

0 comments on commit 923c8ac

Please sign in to comment.