Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conflicting definition of gettimeofday() #32

Open
larskanis opened this issue Feb 16, 2020 · 0 comments
Open

Conflicting definition of gettimeofday() #32

larskanis opened this issue Feb 16, 2020 · 0 comments

Comments

@larskanis
Copy link
Member

Ruby declares gettimeofday() on Windows, but the function is also declared in mingw-w64's sys/time.h. Both definitions are incompatible and extension builds fail, if both ruby.h and sys/time.h are included. This is the related error message from rake gem:native of the grpc gem:

compiling ../../../../src/ruby/ext/grpc/rb_byte_buffer.c
In file included from ../../../../src/ruby/ext/grpc/rb_grpc.h:23:0,
                 from ../../../../src/ruby/ext/grpc/rb_byte_buffer.c:27:
/usr/share/mingw-w64/include/sys/time.h:42:13: error: conflicting types for 'gettimeofday'
 int __cdecl gettimeofday(struct timeval *__restrict__,
             ^~~~~~~~~~~~
In file included from /usr/local/rake-compiler/ruby/i686-w64-mingw32/ruby-2.7.0/include/ruby-2.7.0/ruby/defines.h:371:0,
                 from /usr/local/rake-compiler/ruby/i686-w64-mingw32/ruby-2.7.0/include/ruby-2.7.0/ruby/ruby.h:29,
                 from ../../../../src/ruby/ext/grpc/rb_byte_buffer.c:19:
/usr/local/rake-compiler/ruby/i686-w64-mingw32/ruby-2.7.0/include/ruby-2.7.0/ruby/win32.h:318:12: note: previous declaration of 'gettimeofday' was here
 extern int gettimeofday(struct timeval *, struct timezone *);
            ^~~~~~~~~~~~
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant