aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver/target.h
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2015-05-15 16:00:42 +0100
committerPedro Alves <palves@redhat.com>2015-05-15 16:00:42 +0100
commit452003ef2ca3e1cf81b17d960b59b8a8c167054b (patch)
tree1e85aaf09c40a15f677d455fc586d445864af514 /gdb/gdbserver/target.h
parent52e48b3661a55d5f7cc29591780b844e47157c3f (diff)
downloadgdb-452003ef2ca3e1cf81b17d960b59b8a8c167054b.zip
gdb-452003ef2ca3e1cf81b17d960b59b8a8c167054b.tar.gz
gdb-452003ef2ca3e1cf81b17d960b59b8a8c167054b.tar.bz2
More C++ build fixing
Fixes: In file included from ../../../binutils-gdb/gdb/gdbserver/server.h:61:0, from ../../../binutils-gdb/gdb/gdbserver/server.c:19: ../../../binutils-gdb/gdb/gdbserver/target.h:442:50: error: second operand to the conditional operator is of type 'void', but the third operand is neither a throw-expression nor of type 'void' (*the_target->handle_new_gdb_connection) () : 0) ^ Reported by Yuanhui Zhang. gdb/gdbserver/ChangeLog: 2015-05-15 Pedro Alves <palves@redhat.com> * target.h (target_handle_new_gdb_connection): Rewrite using if wrapped in do/while.
Diffstat (limited to 'gdb/gdbserver/target.h')
-rw-r--r--gdb/gdbserver/target.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/gdb/gdbserver/target.h b/gdb/gdbserver/target.h
index 8d23383..e9c6be0 100644
--- a/gdb/gdbserver/target.h
+++ b/gdb/gdbserver/target.h
@@ -437,9 +437,12 @@ int kill_inferior (int);
(the_target->supports_vfork_events ? \
(*the_target->supports_vfork_events) () : 0)
-#define target_handle_new_gdb_connection() \
- (the_target->handle_new_gdb_connection ? \
- (*the_target->handle_new_gdb_connection) () : 0)
+#define target_handle_new_gdb_connection() \
+ do \
+ { \
+ if (the_target->handle_new_gdb_connection != NULL) \
+ (*the_target->handle_new_gdb_connection) (); \
+ } while (0)
#define detach_inferior(pid) \
(*the_target->detach) (pid)