From 56000a9801956afa7622249f114da778afc8887f Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Mon, 9 Feb 2015 14:59:08 +0000 Subject: Add extern "C" to declarations of C symbols These symbols are defined in C code, so in C++ mode we need to use extern "C" to declare them. As extern "C" can't be used inside a function's scope, we move the declarations to the global scope at the same time. gdb/ChangeLog: 2015-02-27 Pedro Alves * cli-out.c (_rl_erase_entire_line): Move declaration out of cli_mld_erase_entire_line, and make it extern "C". * common/common-defs.h (EXTERN_C): New. * completer.c (_rl_completion_prefix_display_length) (_rl_print_completions_horizontally, QSFUNC): Move declarations out of gdb_display_match_list_1. (_rl_qsort_string_compare): Move declaration out of gdb_display_match_list_1, and make it extern "C". * defs.h (re_comp): Use EXTERN_C. * maint.c (_mcleanup): Move declaration out of mcleanup_wrapper, and make it extern "C". (monstartup): Move declaration out of maintenance_set_profile_cmd, and make it extern "C". (main): Move declaration out of maintenance_set_profile_cmd. * nat/linux-ptrace.c (linux_ptrace_attach_fail_reason_string): Use EXTERN_C. --- gdb/defs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gdb/defs.h') diff --git a/gdb/defs.h b/gdb/defs.h index a1cd45f..72512f6 100644 --- a/gdb/defs.h +++ b/gdb/defs.h @@ -249,7 +249,7 @@ extern int annotation_level; /* in stack.c */ "const char *" in unistd.h, so we can't declare the argument as "char *". */ -extern char *re_comp (const char *); +EXTERN_C char *re_comp (const char *); /* From symfile.c */ -- cgit v1.1