This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH] Add 'extern C' if simulator is written in C++
- From: Павел Крюков <kryukov at frtk dot ru>
- To: gdb-patches at sourceware dot org
- Cc: vapier at gentoo dot org
- Date: Mon, 31 Dec 2018 14:53:54 +0300
- Subject: [PATCH] Add 'extern C' if simulator is written in C++
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 --git a/sim/common/sim-base.h b/sim/common/sim-base.h
index 524195e8ad..e5f295458d 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 */