diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2012-09-07 05:01:21 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2012-09-07 05:01:21 +0000 |
commit | 03bf03fc2ba50930d910522b4a12c86e3e1d834d (patch) | |
tree | ca5f0cef211e9ac160a7da579eee18ea2e82e223 /regress/lib/csu | |
parent | 90c718e7b529c27c6583279c0710f0edd9b94fcf (diff) |
Give this a chance to build with gcc2. ok matthew@
Diffstat (limited to 'regress/lib/csu')
-rw-r--r-- | regress/lib/csu/init_priority/Makefile | 7 | ||||
-rw-r--r-- | regress/lib/csu/init_priority/init_priority_test.cc | 8 |
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); |