ruby-changes:42112
From: naruse <ko1@a...>
Date: Sat, 19 Mar 2016 04:06:39 +0900 (JST)
Subject: [ruby-changes:42112] naruse:r54186 (trunk): * configure.in (rb_cv_member_struct_tm_tm_gmtoff): For Linux (glibc)
naruse 2016-03-19 04:06:32 +0900 (Sat, 19 Mar 2016) New Revision: 54186 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=54186 Log: * configure.in (rb_cv_member_struct_tm_tm_gmtoff): For Linux (glibc) define _BSD_SOURCE for time.h to define struct tm.tm_gmtoff. * time.c: define _BSD_SOURCE at the top. Modified files: trunk/ChangeLog trunk/configure.in trunk/time.c Index: configure.in =================================================================== --- configure.in (revision 54185) +++ configure.in (revision 54186) @@ -2609,7 +2609,12 @@ if test "$use_setreuid" = yes; then https://github.com/ruby/ruby/blob/trunk/configure.in#L2609 fi AC_STRUCT_TIMEZONE AC_CACHE_CHECK(for struct tm.tm_gmtoff, rb_cv_member_struct_tm_tm_gmtoff, - [AC_TRY_COMPILE([@%:@include <time.h>], + [AC_TRY_COMPILE([ + @%:@include <time.h> +@%:@ifndef _BSD_SOURCE +@%:@define _BSD_SOURCE 1 +@%:@endif + ], [struct tm t; t.tm_gmtoff = 3600;], [rb_cv_member_struct_tm_tm_gmtoff=yes], [rb_cv_member_struct_tm_tm_gmtoff=no])]) Index: time.c =================================================================== --- time.c (revision 54185) +++ time.c (revision 54186) @@ -9,6 +9,7 @@ https://github.com/ruby/ruby/blob/trunk/time.c#L9 **********************************************************************/ +#define _BSD_SOURCE #include "internal.h" #include <sys/types.h> #include <time.h> Index: ChangeLog =================================================================== --- ChangeLog (revision 54185) +++ ChangeLog (revision 54186) @@ -1,3 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Sat Mar 19 03:53:31 2016 NARUSE, Yui <naruse@r...> + + * configure.in (rb_cv_member_struct_tm_tm_gmtoff): For Linux (glibc) + define _BSD_SOURCE for time.h to define struct tm.tm_gmtoff. + + * time.c: define _BSD_SOURCE at the top. + Sat Mar 19 03:00:50 2016 Rei Odaira <Rei.Odaira@g...> * test/-ext-/time/test_new.rb (test_timespec_new): change a gmtoff -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/