aboutsummaryrefslogtreecommitdiff
path: root/time
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2024-12-14 20:12:21 +0800
committerH.J. Lu <hjl.tools@gmail.com>2024-12-15 05:24:19 +0800
commit335ba9b6c1db7030264de7d9e38047f645326e54 (patch)
tree685db365cd22f38549c734ab2bc72c121ae9b784 /time
parent65817569adf011b66d197c773df2d9337da5adb3 (diff)
downloadglibc-335ba9b6c1db7030264de7d9e38047f645326e54.tar.xz
glibc-335ba9b6c1db7030264de7d9e38047f645326e54.zip
Return EXIT_UNSUPPORTED if __builtin_add_overflow unavailable
Since GCC 4.9 doesn't have __builtin_add_overflow: In file included from tst-stringtable.c:180:0: stringtable.c: In function ‘stringtable_finalize’: stringtable.c:185:7: error: implicit declaration of function ‘__builtin_add_overflow’ [-Werror=implicit-function-declaration] else if (__builtin_add_overflow (previous->offset, ^ return EXIT_UNSUPPORTED for GCC 4.9 or older. Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'time')
-rw-r--r--time/tst-ctime.c10
-rw-r--r--time/tst-difftime.c10
-rw-r--r--time/tst-mktime4.c10
3 files changed, 30 insertions, 0 deletions
diff --git a/time/tst-ctime.c b/time/tst-ctime.c
index 8debf15004..204225992a 100644
--- a/time/tst-ctime.c
+++ b/time/tst-ctime.c
@@ -20,6 +20,7 @@
#include <stdlib.h>
#include <support/check.h>
+#if __GNUC_PREREQ (5, 0)
static int
do_test (void)
{
@@ -70,3 +71,12 @@ do_test (void)
}
#include <support/test-driver.c>
+#else
+#include <support/test-driver.h>
+
+int
+main (void)
+{
+ return EXIT_UNSUPPORTED;
+}
+#endif
diff --git a/time/tst-difftime.c b/time/tst-difftime.c
index 5043d55087..5a9a66badb 100644
--- a/time/tst-difftime.c
+++ b/time/tst-difftime.c
@@ -19,6 +19,7 @@
#include <time.h>
#include <support/check.h>
+#if __GNUC_PREREQ (5, 0)
static void
test_difftime_helper (time_t t1, time_t t0, double exp_val)
{
@@ -54,3 +55,12 @@ do_test (void)
}
#include <support/test-driver.c>
+#else
+#include <support/test-driver.h>
+
+int
+main ()
+{
+ return EXIT_UNSUPPORTED;
+}
+#endif
diff --git a/time/tst-mktime4.c b/time/tst-mktime4.c
index 505d9fcc2e..05c833c816 100644
--- a/time/tst-mktime4.c
+++ b/time/tst-mktime4.c
@@ -20,6 +20,7 @@
#include <stdlib.h>
#include <support/check.h>
+#if __GNUC_PREREQ (5, 0)
const struct tm tm0 =
{
.tm_year = 70,
@@ -107,3 +108,12 @@ do_test (void)
}
#include <support/test-driver.c>
+#else
+#include <support/test-driver.h>
+
+int
+main (void)
+{
+ return EXIT_UNSUPPORTED;
+}
+#endif