From 444b3faef5397eee5a06fe0e683d2ac3e6628fdc Mon Sep 17 00:00:00 2001 From: =?utf8?q?=D0=9F=D0=B0=D0=B2=D0=B5=D0=BB=20=D0=9A=D1=80=D1=8E=D0=BA?= =?utf8?q?=D0=BE=D0=B2?= Date: Mon, 31 Dec 2018 14:53:54 +0300 Subject: [PATCH] Add 'extern C' if simulator is written in C++ sim/common/Changelog: 2018-12-31 Pavel I. Kryukov * sim-base.h: Add 'extern C' if header is compiled with C++ --- 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 + + * sim-base.h: Add 'extern C' if header is compiled with C++. + 2018-12-06 Andrew Burgess * 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 . */ #ifndef SIM_BASE_H #define SIM_BASE_H +#ifdef __cplusplus +extern "C" { +#endif + /* Pre-declare certain types. */ /* typedef 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 */ -- 2.7.4