This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
[binutils-gdb] Add 'extern C' if simulator is written in C++
- From: Simon Marchi <simark at sourceware dot org>
- To: gdb-cvs at sourceware dot org
- Date: 3 Jan 2019 14:45:35 -0000
- Subject: [binutils-gdb] Add 'extern C' if simulator is written in C++
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=444b3faef5397eee5a06fe0e683d2ac3e6628fdc
commit 444b3faef5397eee5a06fe0e683d2ac3e6628fdc
Author: Ð?авел Ð?Ñ?Ñ?ков <kryukov@frtk.ru>
Date: Mon Dec 31 14:53:54 2018 +0300
Add 'extern C' if simulator is written in C++
sim/common/Changelog:
2018-12-31 Pavel I. Kryukov <kryukov@frtk.ru>
* sim-base.h: Add 'extern C' if header is compiled with C++
Diff:
---
sim/ChangeLog | 4 ++++
sim/common/sim-base.h | 8 ++++++++
2 files changed, 12 insertions(+)
diff --git a/sim/ChangeLog b/sim/ChangeLog
index efd1f88..7bee5f7 100644
--- a/sim/ChangeLog
+++ b/sim/ChangeLog
@@ -1,3 +1,7 @@
+2019-01-03 Pavel I. Kryukov <kryukov@frtk.ru>
+
+ * sim-base.h: Add 'extern C' if header is compiled with C++.
+
2018-12-06 Andrew Burgess <andrew.burgess@embecosm.com>
* common/acinclude.m4 (enable-cgen-maint): Support passing path to
diff --git a/sim/common/sim-base.h b/sim/common/sim-base.h
index 6d5fd45..3123c07 100644
--- a/sim/common/sim-base.h
+++ b/sim/common/sim-base.h
@@ -55,6 +55,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
#ifndef SIM_BASE_H
#define SIM_BASE_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Pre-declare certain types. */
/* typedef <target-dependant> sim_cia; */
@@ -224,4 +228,8 @@ typedef struct {
SIM_DESC sim_state_alloc (SIM_OPEN_KIND kind, host_callback *callback);
void sim_state_free (SIM_DESC);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* SIM_BASE_H */