fflush (rl_outstream);
}
-EXTERN_C void _rl_erase_entire_line (void);
+extern "C" void _rl_erase_entire_line (void);
/* CLI version of displayer.erase_entire_line. */
extern int _rl_completion_prefix_display_length;
extern int _rl_print_completions_horizontally;
-EXTERN_C int _rl_qsort_string_compare (const void *, const void *);
+extern "C" int _rl_qsort_string_compare (const void *, const void *);
typedef int QSFUNC (const void *, const void *);
/* GDB version of readline/complete.c:rl_display_match_list.
"const char *" in unistd.h, so we can't declare the argument
as "char *". */
-EXTERN_C char *re_comp (const char *);
+extern "C" char *re_comp (const char *);
/* From symfile.c */
void (*after_char_processing_hook) (void);
\f
#if RL_VERSION_MAJOR == 7
-EXTERN_C void _rl_signal_handler (int);
+extern "C" void _rl_signal_handler (int);
#endif
/* Wrapper function for calling into the readline library. This takes
of the termcap functions will be built from stub-termcap.c. Readline
provides its own extern declarations when there's no termcap.h; do the
same here for the termcap functions used in GDB. */
-EXTERN_C int tgetnum (const char *);
+extern "C" int tgetnum (const char *);
#endif
/* SunOS's curses.h has a '#define reg register' in it. Thank you Sun. */
static int profiling_state;
-EXTERN_C void _mcleanup (void);
+extern "C" void _mcleanup (void);
static void
mcleanup_wrapper (void)
_mcleanup ();
}
-EXTERN_C void monstartup (unsigned long, unsigned long);
+extern "C" void monstartup (unsigned long, unsigned long);
extern int main (int, char **);
static void
#if defined __i386__ || defined __x86_64__
/* Address of the 'ret' instruction in asm code block below. */
-EXTERN_C void linux_ptrace_test_ret_to_nx_instr (void);
+extern "C" void linux_ptrace_test_ret_to_nx_instr (void);
#include <sys/reg.h>
#include <sys/mman.h>
/* See readline's rlprivate.h. */
-EXTERN_C int _rl_term_autowrap;
+extern "C" int _rl_term_autowrap;
/* See utils.h. */
#endif
-EXTERN_C_PUSH
+extern "C" {
/* The linked list of all tracepoints. Marked explicitly as used as
the in-process library doesn't use it for the fast tracepoints
enum eval_result_type values. */
IP_AGENT_EXPORT_VAR int expr_eval_result = expr_eval_no_error;
-EXTERN_C_POP
+}
#ifndef IN_PROCESS_AGENT
/* The tracepoint in which the error occurred. */
-EXTERN_C_PUSH
+extern "C" {
IP_AGENT_EXPORT_VAR struct tracepoint *error_tracepoint;
-EXTERN_C_POP
+}
struct trace_state_variable
{
static LONGEST trace_buffer_size;
-EXTERN_C_PUSH
+extern "C" {
/* Pointer to the block of memory that traceframes all go into. */
IP_AGENT_EXPORT_VAR unsigned char *trace_buffer_hi;
-EXTERN_C_POP
+}
/* Control structure holding the read/write/etc. pointers into the
trace buffer. We need more than one of these to implement a
#ifdef IN_PROCESS_AGENT
/* The target description index for IPA. Passed from gdbserver, used
to select ipa_tdesc. */
-EXTERN_C_PUSH
+extern "C" {
IP_AGENT_EXPORT_VAR int ipa_tdesc_idx;
-EXTERN_C_POP
+}
#endif
static struct regcache *
NULL if it isn't locked. Note that this lock *must* be set while
executing any *function other than the jump pad. See
fast_tracepoint_collecting. */
-EXTERN_C_PUSH
+extern "C" {
IP_AGENT_EXPORT_VAR collecting_t *collecting;
-EXTERN_C_POP
+}
/* This is needed for -Wmissing-declarations. */
IP_AGENT_EXPORT_FUNC void gdb_collect (struct tracepoint *tpoint,
typedef LONGEST (*get_trace_state_variable_value_ptr_type) (int);
typedef void (*set_trace_state_variable_value_ptr_type) (int, LONGEST);
-EXTERN_C_PUSH
+extern "C" {
IP_AGENT_EXPORT_VAR gdb_collect_ptr_type gdb_collect_ptr = gdb_collect;
IP_AGENT_EXPORT_VAR get_raw_reg_ptr_type get_raw_reg_ptr = get_raw_reg;
IP_AGENT_EXPORT_VAR get_trace_state_variable_value_ptr_type
get_trace_state_variable_value_ptr = get_trace_state_variable_value;
IP_AGENT_EXPORT_VAR set_trace_state_variable_value_ptr_type
set_trace_state_variable_value_ptr = set_trace_state_variable_value;
-EXTERN_C_POP
+}
#endif
/* Thread ID of the helper thread. GDBserver reads this to know which
is the help thread. This is an LWP id on Linux. */
-EXTERN_C_PUSH
+extern "C" {
IP_AGENT_EXPORT_VAR int helper_thread_id;
-EXTERN_C_POP
+}
static int
init_named_socket (const char *name)
#include <signal.h>
#include <pthread.h>
-EXTERN_C_PUSH
+extern "C" {
IP_AGENT_EXPORT_VAR int gdb_agent_capability = AGENT_CAPA_STATIC_TRACE;
-EXTERN_C_POP
+}
static void
gdb_agent_init (void)
must also be exported with C linkage. As we can't both use extern
"C" and initialize a variable in the same statement, variables that
don't have a separate declaration must use
- EXTERN_C_PUSH/EXTERN_C_POP around their definition. */
+ extern "C" {...} around their definition. */
#ifdef IN_PROCESS_AGENT
-# define IP_AGENT_EXPORT_FUNC EXTERN_C EXPORTED_SYMBOL ATTR_NOINLINE ATTR_USED
+# define IP_AGENT_EXPORT_FUNC extern "C" EXPORTED_SYMBOL ATTR_NOINLINE ATTR_USED
# define IP_AGENT_EXPORT_VAR EXPORTED_SYMBOL ATTR_USED
-# define IP_AGENT_EXPORT_VAR_DECL EXTERN_C EXPORTED_SYMBOL
+# define IP_AGENT_EXPORT_VAR_DECL extern "C" EXPORTED_SYMBOL
#else
# define IP_AGENT_EXPORT_FUNC static
# define IP_AGENT_EXPORT_VAR
#include "common-exceptions.h"
#include "gdbsupport/poison.h"
-#define EXTERN_C extern "C"
-#define EXTERN_C_PUSH extern "C" {
-#define EXTERN_C_POP }
-
/* Pull in gdb::unique_xmalloc_ptr. */
#include "gdbsupport/gdb_unique_ptr.h"
/* glibc's proc_service.h doesn't wrap itself with extern "C". Need
to do it ourselves. */
-EXTERN_C_PUSH
+extern "C" {
#include <proc_service.h>
-EXTERN_C_POP
+}
#else /* HAVE_PROC_SERVICE_H */
# endif
#endif
-EXTERN_C_PUSH
+extern "C" {
/* Functions in this interface return one of these status codes. */
typedef enum
/* Log a message (sends to gdb_stderr). */
extern void ps_plog (const char *fmt, ...);
-EXTERN_C_POP
+}
#endif /* HAVE_PROC_SERVICE_H */