diff --git a/configure.in b/configure.in index 3a1999c..e054841 100644 --- a/configure.in +++ b/configure.in @@ -1101,6 +1101,7 @@ AC_CHECK_HEADERS(limits.h sys/file.h sys/ioctl.h sys/syscall.h\ sys/mkdev.h sys/utime.h xti.h netinet/in_systm.h float.h ieeefp.h \ ucontext.h intrinsics.h langinfo.h locale.h sys/sendfile.h time.h \ net/socket.h sys/socket.h) +AC_CHECK_HEADERS_ONCE([windows.h]) dnl Check additional types. RUBY_CHECK_SIZEOF(rlim_t, [int long "long long"], [], [ diff --git a/test/fiddle/test_fiddle.rb b/test/fiddle/test_fiddle.rb index fa19aaf..625aaf9 100644 --- a/test/fiddle/test_fiddle.rb +++ b/test/fiddle/test_fiddle.rb @@ -16,4 +16,14 @@ class TestFiddle < Fiddle::TestCase assert_equal(DL.const_get(name), Fiddle.const_get(name)) end end + + def test_windows_constant + require 'rbconfig' + if RbConfig::CONFIG['host_os'] =~ /mswin|mingw/ + assert Fiddle::WINDOWS, "Fiddle::WINDOWS should be 'true' on Windows platforms" + else + refute Fiddle::WINDOWS, "Fiddle::WINDOWS should be 'false' on non-Windows platforms" + end + end + end diff --git a/win32/Makefile.sub b/win32/Makefile.sub index 4e2a069..937e778 100644 --- a/win32/Makefile.sub +++ b/win32/Makefile.sub @@ -450,6 +450,7 @@ $(CONFIG_H): $(MKFILES) $(srcdir)/win32/Makefile.sub $(win_srcdir)/Makefile.sub !endif #define RT_VER $(RT_VER) #define STDC_HEADERS 1 +#define HAVE_WINDOWS_H 1 #define HAVE_SYS_TYPES_H 1 #define HAVE_SYS_STAT_H 1 #define HAVE_STDLIB_H 1