diff --git a/osal/intime/osal_defs.h b/osal/intime/osal_defs.h index e79a1be..b76b328 100644 --- a/osal/intime/osal_defs.h +++ b/osal/intime/osal_defs.h @@ -42,6 +42,11 @@ #ifndef _osal_defs_ #define _osal_defs_ +#ifdef __cplusplus +extern "C" +{ +#endif + #ifndef PACKED #ifdef _MSC_VER #define PACKED_BEGIN __pragma(pack(push, 1)) @@ -58,4 +63,8 @@ #define OSAL_THREAD_FUNC void #define OSAL_THREAD_FUNC_RT void +#ifdef __cplusplus +} +#endif + #endif diff --git a/osal/linux/osal_defs.h b/osal/linux/osal_defs.h index ed6ea69..eaa2123 100644 --- a/osal/linux/osal_defs.h +++ b/osal/linux/osal_defs.h @@ -42,6 +42,11 @@ #ifndef _osal_defs_ #define _osal_defs_ +#ifdef __cplusplus +extern "C" +{ +#endif + #ifndef PACKED #define PACKED_BEGIN #define PACKED __attribute__((__packed__)) @@ -53,4 +58,8 @@ #define OSAL_THREAD_FUNC void #define OSAL_THREAD_FUNC_RT void +#ifdef __cplusplus +} +#endif + #endif diff --git a/osal/osal.h b/osal/osal.h index 5db787b..7f183dd 100644 --- a/osal/osal.h +++ b/osal/osal.h @@ -21,6 +21,11 @@ #ifndef _osal_ #define _osal_ +#ifdef __cplusplus +extern "C" +{ +#endif + #include "osal_defs.h" #include @@ -58,4 +63,8 @@ void osal_time_diff(ec_timet *start, ec_timet *end, ec_timet *diff); int osal_thread_create(void *thandle, int stacksize, void *func, void *param); int osal_thread_create_rt(void *thandle, int stacksize, void *func, void *param); +#ifdef __cplusplus +} +#endif + #endif diff --git a/osal/rtk/osal_defs.h b/osal/rtk/osal_defs.h index c8efe5f..8976f48 100644 --- a/osal/rtk/osal_defs.h +++ b/osal/rtk/osal_defs.h @@ -21,6 +21,11 @@ #ifndef _osal_defs_ #define _osal_defs_ +#ifdef __cplusplus +extern "C" +{ +#endif + #ifndef PACKED #define PACKED_BEGIN #define PACKED __attribute__((__packed__)) @@ -31,4 +36,8 @@ #define OSAL_THREAD_FUNC void #define OSAL_THREAD_FUNC_RT void +#ifdef __cplusplus +} +#endif + #endif diff --git a/osal/win32/osal_defs.h b/osal/win32/osal_defs.h index 4f9bb27..e10e7ec 100644 --- a/osal/win32/osal_defs.h +++ b/osal/win32/osal_defs.h @@ -41,6 +41,11 @@ #ifndef _osal_defs_ #define _osal_defs_ +#ifdef __cplusplus +extern "C" +{ +#endif + #ifndef PACKED #define PACKED_BEGIN __pragma(pack(push, 1)) #define PACKED @@ -51,4 +56,8 @@ #define OSAL_THREAD_FUNC void #define OSAL_THREAD_FUNC_RT void +#ifdef __cplusplus +} +#endif + #endif diff --git a/oshw/linux/oshw.h b/oshw/linux/oshw.h index a9e42a3..9e4f4e1 100644 --- a/oshw/linux/oshw.h +++ b/oshw/linux/oshw.h @@ -47,6 +47,10 @@ #ifndef _oshw_ #define _oshw_ +#ifdef __cplusplus +extern "C" { +#endif + #include "ethercattype.h" #include "nicdrv.h" #include "ethercatmain.h" @@ -56,4 +60,8 @@ uint16 oshw_ntohs(uint16 networkshort); ec_adaptert * oshw_find_adapters(void); void oshw_free_adapters(ec_adaptert * adapter); +#ifdef __cplusplus +} +#endif + #endif diff --git a/oshw/rtk/oshw.h b/oshw/rtk/oshw.h index 9c7bb3c..b6e1b0c 100644 --- a/oshw/rtk/oshw.h +++ b/oshw/rtk/oshw.h @@ -47,6 +47,10 @@ #ifndef _oshw_ #define _oshw_ +#ifdef __cplusplus +extern "C" +{ +#endif #include #include "ethercattype.h" @@ -60,4 +64,8 @@ uint16 oshw_ntohs(uint16 network); ec_adaptert * oshw_find_adapters(void); void oshw_free_adapters(ec_adaptert * adapter); +#ifdef __cplusplus +} +#endif + #endif diff --git a/oshw/win32/oshw.h b/oshw/win32/oshw.h index a0cd90d..0389ede 100644 --- a/oshw/win32/oshw.h +++ b/oshw/win32/oshw.h @@ -47,6 +47,11 @@ #ifndef _oshw_ #define _oshw_ +#ifdef __cplusplus +extern "C" +{ +#endif + #include "ethercattype.h" #include "nicdrv.h" #include "ethercatmain.h" @@ -56,4 +61,8 @@ uint16 oshw_ntohs (uint16 networkshort); ec_adaptert * oshw_find_adapters (void); void oshw_free_adapters (ec_adaptert * adapter); +#ifdef __cplusplus +} +#endif + #endif diff --git a/soem/ethercatconfiglist.h b/soem/ethercatconfiglist.h index 9f86b7f..d3fb26d 100644 --- a/soem/ethercatconfiglist.h +++ b/soem/ethercatconfiglist.h @@ -51,6 +51,11 @@ #ifndef _ethercatconfiglist_ #define _ethercatconfiglist_ +#ifdef __cplusplus +extern "C" +{ +#endif + /* explanation of dev: 1: static device with no IO mapping ie EK1100 @@ -90,4 +95,8 @@ ec_configlist_t ec_configlist[] = { {/*Man=*/EC_CONFIGEND,/*ID=*/0x00000000,/*Name=*/"" ,/*dtype=*/0,/*Ibits=*/ 0,/*Obits=*/ 0,/*SM2a*/ 0,/*SM2f*/ 0,/*SM3a*/ 0,/*SM3f*/ 0,/*FM0ac*/0,/*FM1ac*/0} }; +#ifdef __cplusplus +} +#endif + #endif