From 03bf03fc2ba50930d910522b4a12c86e3e1d834d Mon Sep 17 00:00:00 2001 From: Miod Vallat Date: Fri, 7 Sep 2012 05:01:21 +0000 Subject: Give this a chance to build with gcc2. ok matthew@ --- regress/lib/csu/init_priority/Makefile | 7 ++++++- regress/lib/csu/init_priority/init_priority_test.cc | 8 ++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) (limited to 'regress/lib/csu') 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 +.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 @@ -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); -- cgit v1.2.3