More C++ build fixing
authorPedro Alves <palves@redhat.com>
Fri, 15 May 2015 15:00:42 +0000 (16:00 +0100)
committerPedro Alves <palves@redhat.com>
Fri, 15 May 2015 15:00:42 +0000 (16:00 +0100)
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.

gdb/gdbserver/ChangeLog
gdb/gdbserver/target.h

index 1fc24be35546c74171352621bb52105baf5d8cd0..0f30c66d0eef3038b883d23c58b3be0ac5b89ea7 100644 (file)
@@ -1,3 +1,8 @@
+2015-05-15  Pedro Alves  <palves@redhat.com>
+
+       * target.h (target_handle_new_gdb_connection): Rewrite using if
+       wrapped in do/while.
+
 2015-05-14  Joel Brobecker  <brobecker@adacore.com>
 
        * configure.ac: Add prfpregset_t BFD_HAVE_SYS_PROCFS_TYPE check.
index 8d233834ceefd51e1013eca89518c5b95188e4d8..e9c6be06e64fab99e7f3bd1bd3fe1c4bbcde0b04 100644 (file)
@@ -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)
This page took 0.035882 seconds and 4 git commands to generate.