summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormiod <miod@openbsd.org>2012-09-07 05:01:20 +0000
committermiod <miod@openbsd.org>2012-09-07 05:01:20 +0000
commited45137101a38982ffe9800725e0b130bafddf26 (patch)
tree27fde51b8e328ef8b8df9260d21dbd65ad1e6ec1
parentMerge escape help text for ~v and ~V; ok djm@ (diff)
downloadwireguard-openbsd-ed45137101a38982ffe9800725e0b130bafddf26.tar.xz
wireguard-openbsd-ed45137101a38982ffe9800725e0b130bafddf26.zip
Give this a chance to build with gcc2. ok matthew@
-rw-r--r--regress/lib/csu/init_priority/Makefile7
-rw-r--r--regress/lib/csu/init_priority/init_priority_test.cc8
2 files changed, 12 insertions, 3 deletions
diff --git a/regress/lib/csu/init_priority/Makefile b/regress/lib/csu/init_priority/Makefile
index 3b7b751c8cc..837ccdf213f 100644
--- a/regress/lib/csu/init_priority/Makefile
+++ b/regress/lib/csu/init_priority/Makefile
@@ -1,4 +1,9 @@
-# $OpenBSD: Makefile,v 1.1 2012/09/06 22:13:44 matthew Exp $
+# $OpenBSD: Makefile,v 1.2 2012/09/07 05:01:20 miod Exp $
+
+.include <bsd.own.mk>
+.if ${COMPILER_VERSION} == "gcc2"
+CFLAGS+= -finit-priority
+.endif
PROG=init_priority_test
SRCS=init_priority_test.cc
diff --git a/regress/lib/csu/init_priority/init_priority_test.cc b/regress/lib/csu/init_priority/init_priority_test.cc
index 6855dd93717..4e1edddaa65 100644
--- a/regress/lib/csu/init_priority/init_priority_test.cc
+++ b/regress/lib/csu/init_priority/init_priority_test.cc
@@ -1,4 +1,4 @@
-/* $OpenBSD: init_priority_test.cc,v 1.1 2012/09/06 22:13:44 matthew Exp $ */
+/* $OpenBSD: init_priority_test.cc,v 1.2 2012/09/07 05:01:20 miod Exp $ */
#include <cassert>
@@ -18,7 +18,11 @@ Test::Test(int x)
counter++;
}
-#define TEST(n) Test test_##n __attribute__((init_priority(n))) (n);
+#if __GNUC__ < 3
+#define TEST(n) Test test_##n (n) __attribute__((init_priority (n)))
+#else
+#define TEST(n) Test test_##n __attribute__((init_priority (n))) (n)
+#endif
TEST(12597);
TEST(20840);
TEST(31319);