| 1 |
# tm_gmtoff.m4 |
| 2 |
# serial 5 |
| 3 |
dnl Copyright (C) 2002, 2009-2024 Free Software Foundation, Inc. |
| 4 |
dnl This file is free software; the Free Software Foundation |
| 5 |
dnl gives unlimited permission to copy and/or distribute it, |
| 6 |
dnl with or without modifications, as long as this notice is preserved. |
| 7 |
dnl This file is offered as-is, without any warranty. |
| 8 |
|
| 9 |
dnl Check for tm_gmtoff and tm_zone in struct tm, and #define |
| 10 |
dnl HAVE_STRUCT_TM_TM_GMTOFF and HAVE_STRUCT_TM_TM_ZONE accordingly. |
| 11 |
dnl Most code that needs one needs the other, so there seemed little |
| 12 |
dnl point to having two macros to check them individually. |
| 13 |
dnl Although all platforms that we know of have either both members or |
| 14 |
dnl neither member, check for the two members separately just in case. |
| 15 |
dnl |
| 16 |
dnl These days this macro is more useful than AC_STRUCT_TIMEZONE, which also |
| 17 |
dnl checks for the obsolescent tzname and does not check for tm_gmtoff. |
| 18 |
AC_DEFUN([gl_TM_GMTOFF], |
| 19 |
[ |
| 20 |
AC_CHECK_MEMBERS([struct tm.tm_gmtoff, struct tm.tm_zone], [], [], |
| 21 |
[[#include <time.h> |
| 22 |
]]) |
| 23 |
|
| 24 |
dnl Backward compatibility with 2024-and-earlier versions of this macro. |
| 25 |
AS_IF([test "$ac_cv_member_struct_tm_tm_gmtoff" = yes], |
| 26 |
[AC_DEFINE([HAVE_TM_GMTOFF], [1], |
| 27 |
[Define if struct tm has the tm_gmtoff member. |
| 28 |
This macro is obsolete. |
| 29 |
New code should use HAVE_STRUCT_TM_TM_GMTOFF.])]) |
| 30 |
]) |