From 6a38401c78a02b9bd14e50966ecdd54a003597b7 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Mon, 10 Aug 2009 13:01:30 -0700 Subject: Simplify _ELFUTILS_PREREQ checking We were jumping through a few hoops to deal with elfutils < 0.138 that did not have the _ELFUTILS_PREREQ macro. I've added an always-false dummy macro to take its place when it doesn't exit. All of the other "#ifdef _ELFUTILS_PREREQ" ugliness can now go away. --- loc2c-test.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'loc2c-test.c') diff --git a/loc2c-test.c b/loc2c-test.c index 79cb3296..3c260385 100644 --- a/loc2c-test.c +++ b/loc2c-test.c @@ -21,6 +21,11 @@ #include #include "loc2c.h" +#if !defined(_ELFUTILS_PREREQ) +// make a dummy PREREQ check for elfutils < 0.138 +#define _ELFUTILS_PREREQ(major, minor) (0 >= 1) +#endif + #define _(msg) msg static void __attribute__ ((noreturn)) @@ -519,7 +524,6 @@ main (int argc, char **argv) { Dwarf_Op *cfa_ops = NULL; -#ifdef _ELFUTILS_PREREQ #if _ELFUTILS_PREREQ(0,142) size_t cfa_nops; Dwarf_Addr bias; @@ -546,7 +550,6 @@ main (int argc, char **argv) } } #endif -#endif handle_variable (scopes, n, out, cubias, &vardie, pc, cfa_ops, &argv[argi]); -- cgit