diff --git a/debuginfod/debuginfod.cxx b/debuginfod/debuginfod.cxx index 4271acf4..1ea90645 100644 --- a/debuginfod/debuginfod.cxx +++ b/debuginfod/debuginfod.cxx @@ -45,7 +45,6 @@ extern "C" { #endif extern "C" { -#include "printversion.h" #include "system.h" } @@ -345,13 +344,11 @@ static const char DEBUGINFOD_SQLITE_CLEANUP_DDL[] = ; - - -/* Name and version of program. */ -/* ARGP_PROGRAM_VERSION_HOOK_DEF = print_version; */ // not this simple for C++ - -/* Bug report address. */ -ARGP_PROGRAM_BUG_ADDRESS_DEF = PACKAGE_BUGREPORT; +extern "C" { +/* Defined in version.c. Explicitly declared here because including + print_version.h magic variable tricks don't work in C++. */ +void print_version (FILE *stream, struct argp_state *state); +} /* Definitions of arguments for argp functions. */ static const struct argp_option options[] = @@ -4172,6 +4169,7 @@ main (int argc, char *argv[]) /* Parse and process arguments. */ int remaining; argp_program_version_hook = print_version; // this works + argp_program_bug_address = PACKAGE_BUGREPORT; (void) argp_parse (&argp, argc, argv, ARGP_IN_ORDER, &remaining, NULL); if (remaining != argc) error (EXIT_FAILURE, 0,