Project

General

Profile

Actions

Bug #2587

closed

Forced definition of struct timezone under MinGW

Added by luislavena (Luis Lavena) about 14 years ago. Updated almost 13 years ago.

Status:
Closed
Assignee:
-
Target version:
ruby -v:
ruby 1.9.1p376 (2009-12-07 revision 26041) [i386-mingw32]
Backport:
[ruby-core:27515]

Description

=begin
It appears that win32.h is forcing the definition of timezone structure, even when it has been defined by MinGW provided headers.

The output from compilation of miniruby:

 In file included from ../include/ruby/defines.h:205:0,
                  from ../include/ruby/ruby.h:73,
                  from ../include/ruby.h:32,
                  from ../main.c:13:
 ../include/ruby/win32.h:201:8: error: redefinition of 'struct timezone'
 

And the code that defines it:


 #ifdef __MINGW32__
 struct timezone {
   int tz_minuteswest;
   int tz_dsttime;
 };
 #undef isascii
 #define isascii __isascii
 #endif
 

It is clear that this was made to workaround limitations of older versions of MinGW, but a simple check with AC_CHECK_TYPES (or if specific are needed: AC_CHECK_MEMBERS), any of those could provide the defines needed to avoid the forced redefinition.

Please find attached a naive patch for configure.in and win32.h that use HAVE_STRUCT_TIMEZONE

Thank you.
=end


Files


Related issues 1 (0 open1 closed)

Related to Backport187 - Backport #3666: Backport of r26311 (Bug #2587)Closedshyouhei (Shyouhei Urabe)08/08/2010Actions
Actions #1

Updated by rogerdpack (Roger Pack) about 14 years ago

=begin
is this a cross compile? Which version of gcc?
r
=end

Actions #2

Updated by luislavena (Luis Lavena) about 14 years ago

=begin
Roger:

No cross-compiler, native.

Timezone is part of the newer w32api packages for MinGW. Will grab the versions and follow once I have the computer around.

--

=end

Actions #3

Updated by nobu (Nobuyoshi Nakada) about 14 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

=begin
This issue was solved with changeset r26311.
Luis, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.

=end

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0