Hello,
Recently an issue has been reported to RubyInstaller mailing list:
https://groups.google.com/d/topic/rubyinstaller/s9AqoUOxo3I/discussion
Normally these issues indicate incorrect compiler used between RubyInstaller and the one installed with it, but in this particular case, I was able to confirm the issue:
generating msgpack-i386-mingw32.def
compiling ../../../../ext/msgpack/buffer.c
In file included from c:/Tools/Ruby/ruby-2.0.0-p451-i386-mingw32/include/ruby-2.0.0/ruby/defines.h:153:0,
from c:/Tools/Ruby/ruby-2.0.0-p451-i386-mingw32/include/ruby-2.0.0/ruby/ruby.h:70,
from c:/Tools/Ruby/ruby-2.0.0-p451-i386-mingw32/include/ruby-2.0.0/ruby.h:33,
from ../../../../ext/msgpack/compat.h:21,
from ../../../../ext/msgpack/buffer.h:21,
from ../../../../ext/msgpack/buffer.c:19:
c:/Tools/Ruby/ruby-2.0.0-p451-i386-mingw32/include/ruby-2.0.0/ruby/win32.h: In function 'rb_w32_pow':
c:/Tools/Ruby/ruby-2.0.0-p451-i386-mingw32/include/ruby-2.0.0/ruby/win32.h:801:5: warning: implicit declaration of function '_controlfp' [-Wimplicit-function-declaration]
c:/Tools/Ruby/ruby-2.0.0-p451-i386-mingw32/include/ruby-2.0.0/ruby/win32.h:802:16: error: '_PC_64' undeclared (first use in this function)
c:/Tools/Ruby/ruby-2.0.0-p451-i386-mingw32/include/ruby-2.0.0/ruby/win32.h:802:16: note: each undeclared identifier is reported only once for each function it appears in
c:/Tools/Ruby/ruby-2.0.0-p451-i386-mingw32/include/ruby-2.0.0/ruby/win32.h:802:24: error: '_MCW_PC' undeclared (first use in this function)
make: *** [buffer.o] Error 1
rake aborted!
Command failed with status (2): [make...]
Tasks: TOP => compile => compile:i386-mingw32 => compile:msgpack:i386-mingw32 => copy:msgpack:i386-m
ingw32:2.0.0 => tmp/i386-mingw32/msgpack/2.0.0/msgpack.so
(See full trace by running task with --trace)
Found a similar report in ticket on Mongoid: mongoid/mongoid#3489
I was able to reproduce locally with my test-ruby-c-extension project by adding c99
to $CFLAGS
:
Beyond that the compiler flag is been used outside a condition to allow mswin32
-based compilers to work, Ruby's own headers are not C99 compliant.
On #23 you mention you cross-compile the extension, however I'm not sure which version of the compiler you're using, as the ones used by RubyInstaller 2.0.0 (4.7.2) fail:
https://gist.github.com/luislavena/9297429
You can reproduce this issue by using rake-compiler-dev-box
As you know, the speed on which changes to Ruby happens might not be fast enough to get this issue sorted out.
Is there a chance for you to make C99 forcing optional if you're targeting mswin32|mingw32
?
If that is OK with you, I would love to send a pull request to get that sorted out.
Thank you for your time.