Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/tests/lib/libm portability fixes
details: https://anonhg.NetBSD.org/src/rev/dfebcb20f603
branches: trunk
changeset: 347381:dfebcb20f603
user: christos <christos%NetBSD.org@localhost>
date: Tue Aug 23 10:03:44 2016 +0000
description:
portability fixes
diffstat:
tests/lib/libm/Makefile | 3 ++-
tests/lib/libm/t_ilogb.c | 17 ++++++++++++-----
2 files changed, 14 insertions(+), 6 deletions(-)
diffs (55 lines):
diff -r cfa1ece40031 -r dfebcb20f603 tests/lib/libm/Makefile
--- a/tests/lib/libm/Makefile Tue Aug 23 10:00:15 2016 +0000
+++ b/tests/lib/libm/Makefile Tue Aug 23 10:03:44 2016 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.38 2016/08/22 08:49:33 maya Exp $
+# $NetBSD: Makefile,v 1.39 2016/08/23 10:03:44 christos Exp $
.include <bsd.own.mk>
@@ -9,6 +9,7 @@
.endif
CPPFLAGS.t_fenv.c+= -D__TEST_FENV
+CPPFLAGS.t_ilogb.c+= -D__TEST_FENV
CPPFLAGS.t_fmod.c+= -I${.CURDIR}/../libc/gen
TESTS_C+= t_acos
diff -r cfa1ece40031 -r dfebcb20f603 tests/lib/libm/t_ilogb.c
--- a/tests/lib/libm/t_ilogb.c Tue Aug 23 10:00:15 2016 +0000
+++ b/tests/lib/libm/t_ilogb.c Tue Aug 23 10:03:44 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: t_ilogb.c,v 1.2 2016/08/22 10:36:20 maya Exp $ */
+/* $NetBSD: t_ilogb.c,v 1.3 2016/08/23 10:03:44 christos Exp $ */
/*-
* Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -33,17 +33,24 @@
#include <fenv.h>
#include <math.h>
-#define ATF_CHECK_RAISED_INVALID do { \
+#ifndef __HAVE_FENV
+
+# define ATF_CHECK_RAISED_INVALID
+# define ATF_CHECK_RAISED_NOTHING
+
+#else
+# define ATF_CHECK_RAISED_INVALID do { \
int r; \
r = feclearexcept(FE_ALL_EXCEPT); \
ATF_CHECK(r == FE_INVALID); \
- } while (0)
+} while (/*CONSTCOND*/0)
-#define ATF_CHECK_RAISED_NOTHING do { \
+# define ATF_CHECK_RAISED_NOTHING do { \
int r; \
r = feclearexcept(FE_ALL_EXCEPT); \
ATF_CHECK(r == 0); \
- } while (0)
+} while (/*CONSTCOND*/0)
+#endif
ATF_TC(ilogb);
ATF_TC_HEAD(ilogb, tc)
Home |
Main Index |
Thread Index |
Old Index