Try to make timezone parsing more robust: always use standard header for posix time zone files.

This commit is contained in:
Richard Frith-Macdonald 2021-07-29 10:35:19 +01:00
parent 0b3f2a9fb0
commit 3b8bbb00ba
5 changed files with 14 additions and 31 deletions

View file

@ -1,3 +1,13 @@
2021-07-29 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSTimeZone.m:
* Headers/GNUstepBase/config.h.in:
* configure.ac:
* configure:
Always use builtin header for parsing posix time zone files, so we
know that the field names are consistent and so we knw we have a
define for the file magic number.
2021-07-26 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSXMLParser.m:

View file

@ -712,9 +712,6 @@
/* Define to 1 if you have the <tzfile.h> header file. */
#undef HAVE_TZFILE_H
/* Define if tzfile.h includes the proper definitions */
#undef HAVE_TZHEAD
/* Define to 1 if you have the `tzset' function. */
#undef HAVE_TZSET

View file

@ -110,11 +110,11 @@
#import "GSPrivate.h"
#import "GSPThread.h"
#ifdef HAVE_TZHEAD
#include <tzfile.h>
#else
/* In systems without POSIX time zone information we can use our own builtin
* time zone data. To build on those systems we need a header reproducing
* the POSIX time zone file format.
*/
#include "nstzfile.h"
#endif
#if defined(HAVE_UNICODE_UCAL_H)
#define id id_ucal

17
configure vendored
View file

@ -8920,23 +8920,6 @@ fi
done
# Check if tzfile contains the proper definitions
if test $ac_cv_header_tzfile_h = yes; then
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <tzfile.h>
_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
$EGREP "tzhead" >/dev/null 2>&1; then :
$as_echo "#define HAVE_TZHEAD 1" >>confdefs.h
fi
rm -f conftest*
fi
#--------------------------------------------------------------------
# These headers/functions needed by GSTcpPort.m
#--------------------------------------------------------------------

View file

@ -2322,13 +2322,6 @@ dnl AC_REPLACE_FUNCS(getrusage gettimeofday)
AC_CHECK_HEADERS(time.h sys/time.h tzfile.h sys/rusage.h ucbinclude/sys/resource.h)
AC_CHECK_FUNCS(time ctime tzset)
# Check if tzfile contains the proper definitions
if test $ac_cv_header_tzfile_h = yes; then
AC_EGREP_HEADER(tzhead, tzfile.h,
AC_DEFINE(HAVE_TZHEAD,1,
[ Define if tzfile.h includes the proper definitions]),)
fi
#--------------------------------------------------------------------
# These headers/functions needed by GSTcpPort.m
#--------------------------------------------------------------------