pkgsrc/devel/blame/patches/patch-lib_mktime_c
dholland 067d5ee670 Disable (on NetBSD) ill-conceived GNUish mktime() code that generates
a compile-time assertion. There is no need for this code on NetBSD, or
probably anywhere else, as mktime() is a standard part of libc.

The broken code was apparently reported upstream last year, with
predictable results: http://sourceware.org/bugzilla/show_bug.cgi?id=12401

While here also fix the mktime configure test, which exercises
undefined behavior. With gcc 4.5 this causes the build to hang in an
infinite loop for sixty seconds until an alarm() goes off.

Fixes the build on 32-bit NetBSD.
2012-12-17 01:28:29 +00:00

28 lines
672 B
Text
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

$NetBSD: patch-lib_mktime_c,v 1.1 2012/12/17 01:28:29 dholland Exp $
This code is broken and uncompilable on 32-bit NetBSD. The problem
is the same as reported here:
http://sourceware.org/bugzilla/show_bug.cgi?id=12401
The path of least resistance is just to skip the entire file on
NetBSD, as there is a perfectly good mktime() in libc.
--- lib/mktime.c~ 2006-11-18 10:07:43.000000000 +0000
+++ lib/mktime.c
@@ -21,6 +21,8 @@
mktime. */
/* #define DEBUG 1 */
+#ifndef __NetBSD__
+
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
@@ -657,6 +659,7 @@ main (int argc, char **argv)
}
#endif /* DEBUG */
+#endif /* __NetBSD__ */
/*
Local Variables: