diff options
author | Pedro Alves <palves@redhat.com> | 2015-02-09 14:59:08 +0000 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2015-02-27 17:26:16 +0000 |
commit | 56000a9801956afa7622249f114da778afc8887f (patch) | |
tree | cde7dfd0a133e8dae0f38d0cec5f7599869b260a /gdb/maint.c | |
parent | bcabf4207e7ba20f09e15141c6c3241862ac4aee (diff) | |
download | gdb-56000a9801956afa7622249f114da778afc8887f.zip gdb-56000a9801956afa7622249f114da778afc8887f.tar.gz gdb-56000a9801956afa7622249f114da778afc8887f.tar.bz2 |
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 <palves@redhat.com>
* 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.
Diffstat (limited to 'gdb/maint.c')
-rw-r--r-- | gdb/maint.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/gdb/maint.c b/gdb/maint.c index be18a32..1adea2f 100644 --- a/gdb/maint.c +++ b/gdb/maint.c @@ -683,15 +683,18 @@ extern char etext; static int profiling_state; +EXTERN_C void _mcleanup (void); + static void mcleanup_wrapper (void) { - extern void _mcleanup (void); - if (profiling_state) _mcleanup (); } +EXTERN_C void monstartup (unsigned long, unsigned long); +extern int main (); + static void maintenance_set_profile_cmd (char *args, int from_tty, struct cmd_list_element *c) @@ -705,9 +708,6 @@ maintenance_set_profile_cmd (char *args, int from_tty, { static int profiling_initialized; - extern void monstartup (unsigned long, unsigned long); - extern int main(); - if (!profiling_initialized) { atexit (mcleanup_wrapper); |