Wrap a few opcodes headers in extern "C" for C++
authorPedro Alves <palves@redhat.com>
Thu, 12 Feb 2015 09:59:03 +0000 (09:59 +0000)
committerPedro Alves <palves@redhat.com>
Thu, 19 Feb 2015 22:45:47 +0000 (22:45 +0000)
These are sufficient to link an --enable-targets=all GDB build in C++
mode, on x86_64 Fedora 20.

include/opcode/
2015-02-19  Pedro Alves  <palves@redhat.com>

* cgen.h [__cplusplus]: Wrap in extern "C".
* msp430-decode.h [__cplusplus]: Likewise.
* nios2.h [__cplusplus]: Likewise.
* rl78.h [__cplusplus]: Likewise.
* rx.h [__cplusplus]: Likewise.
* tilegx.h [__cplusplus]: Likewise.

opcodes/
2015-02-19  Pedro Alves  <palves@redhat.com>

* microblaze-dis.h [__cplusplus]: Wrap in extern "C".

include/opcode/ChangeLog
include/opcode/cgen.h
include/opcode/msp430-decode.h
include/opcode/nios2.h
include/opcode/rl78.h
include/opcode/rx.h
include/opcode/tilegx.h
opcodes/ChangeLog
opcodes/microblaze-dis.h

index 52fd462..36bc335 100644 (file)
@@ -1,3 +1,12 @@
+2015-02-19  Pedro Alves  <palves@redhat.com>
+
+       * cgen.h [__cplusplus]: Wrap in extern "C".
+       * msp430-decode.h [__cplusplus]: Likewise.
+       * nios2.h [__cplusplus]: Likewise.
+       * rl78.h [__cplusplus]: Likewise.
+       * rx.h [__cplusplus]: Likewise.
+       * tilegx.h [__cplusplus]: Likewise.
+
 2015-01-28  James Bowman  <james.bowman@ftdichip.com>
 
        * ft32.h: New file.
index a23f0fd..0efbe79 100644 (file)
 /* ??? IWBN to replace bfd in the name.  */
 #include "bfd_stdint.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /* ??? This file requires bfd.h but only to get bfd_vma.
    Seems like an awful lot to require just to get such a fundamental type.
    Perhaps the definition of bfd_vma can be moved outside of bfd.h.
@@ -1476,4 +1480,8 @@ extern void cgen_clear_signed_overflow_ok (CGEN_CPU_DESC);
 /* Will an error message be generated if a signed field in an instruction overflows ? */
 extern unsigned int cgen_signed_overflow_ok_p (CGEN_CPU_DESC);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* OPCODE_CGEN_H */
index 3960278..3edd3f2 100644 (file)
    Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
    02110-1301, USA.  */
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 typedef enum
 {
   MSO_unknown,
@@ -128,3 +132,7 @@ typedef struct
 } MSP430_Opcode_Decoded;
 
 int msp430_decode_opcode (unsigned long, MSP430_Opcode_Decoded *, int (*)(void *), void *);
+
+#ifdef __cplusplus
+}
+#endif
index 44dffb7..cbd2b8c 100644 (file)
 
 #include "bfd.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /****************************************************************************
  * This file contains structures, bit masks and shift counts used
  * by the GNU toolchain to define the Nios II instruction set and
@@ -153,4 +157,8 @@ extern int nios2_num_regs;
 extern const struct nios2_opcode *
 nios2_find_opcode_hash (unsigned long, unsigned long);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _NIOS2_H */
index 5495c4c..72adf14 100644 (file)
 #ifndef RL78_OPCODES_H_INCLUDED
 #define RL78_OPCODES_H_INCLUDED
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /* For the purposes of these structures, the RL78 registers are as
    follows, despite most of these being memory-mapped and
    bank-switched:  */
@@ -164,4 +168,8 @@ typedef struct
 
 int rl78_decode_opcode (unsigned long, RL78_Opcode_Decoded *, int (*)(void *), void *);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif
index e4fe05d..41557b2 100644 (file)
    analyzer, and the disassembler.  Given an opcode data source,
    it decodes the next opcode into the following structures.  */
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 typedef enum
 {
   RX_AnySize = 0,
@@ -212,3 +216,7 @@ typedef struct
    registers.  32..47 are condition codes.  */
 
 int rx_decode_opcode (unsigned long, RX_Opcode_Decoded *, int (*)(void *), void *);
+
+#ifdef __cplusplus
+}
+#endif
index e0d8aee..ae8f95b 100644 (file)
 #ifndef opcode_tile_h
 #define opcode_tile_h
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 typedef unsigned long long tilegx_bundle_bits;
 
 
@@ -1301,4 +1305,8 @@ typedef tilegx_bundle_bits tile_bundle_bits;
 #define TILE_LOG2_BUNDLE_ALIGNMENT_IN_BYTES \
   TILEGX_LOG2_BUNDLE_ALIGNMENT_IN_BYTES
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* opcode_tilegx_h */
index b400f5b..ddb04b8 100644 (file)
@@ -1,3 +1,7 @@
+2015-02-19  Pedro Alves  <palves@redhat.com>
+
+       * microblaze-dis.h [__cplusplus]: Wrap in extern "C".
+
 2015-02-10  Pedro Alves  <palves@redhat.com>
            Tom Tromey  <tromey@redhat.com>
 
index a837ada..fd09745 100644 (file)
 #ifndef MICROBLAZE_DIS_H
 #define MICROBLAZE_DIS_H 1
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 extern enum microblaze_instr microblaze_decode_insn (long, int *, int *, 
                                                     int *, int *);
 extern unsigned long microblaze_get_target_address (long, bfd_boolean, int,
@@ -31,4 +35,8 @@ extern enum microblaze_instr get_insn_microblaze (long, bfd_boolean *,
                                                  enum microblaze_instr_type *,
                                                  short *);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* microblaze-dis.h */