File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -176,6 +176,20 @@ conf.set10(
176176 ),
177177 description : ' Does struct opal_key have a key_type field?'
178178)
179+ conf.set(
180+ ' HAVE_TM_GMTOFF' ,
181+ cc.compiles(
182+ '''
183+ #include <time.h>
184+ int main(void) {
185+ struct tm tm;
186+ tm.tm_gmtoff = 1;
187+ }
188+ ''' ,
189+ name : ' tm_gmtoff'
190+ ),
191+ description : ' Does struct tm have a tm_gmtoff field?'
192+ )
179193
180194if cc.has_function_attribute(' fallthrough' )
181195 conf.set(' fallthrough' , ' __attribute__((__fallthrough__))' )
Original file line number Diff line number Diff line change @@ -81,11 +81,11 @@ int wdc_UtilsGetTime(PUtilsTimeInfo timeInfo)
8181 timeInfo -> second = currTimeInfo .tm_sec ;
8282 timeInfo -> msecs = 0 ;
8383 timeInfo -> isDST = currTimeInfo .tm_isdst ;
84- #if (defined( __GLIBC__ ) && !defined( __UCLIBC__ ) && !defined( __MUSL__ )) || defined( __FreeBSD__ )
84+ #ifdef HAVE_TM_GMTOFF
8585 timeInfo -> zone = - currTimeInfo .tm_gmtoff / 60 ;
86- #else
86+ #else /* HAVE_TM_GMTOFF */
8787 timeInfo -> zone = -1 * (timezone / SECONDS_IN_MIN );
88- #endif
88+ #endif /* HAVE_TM_GMTOFF */
8989
9090 return WDC_STATUS_SUCCESS ;
9191}
You can’t perform that action at this time.
0 commit comments