From d2be650eee5da77ef54f43cb15e7b6e24d57323d Mon Sep 17 00:00:00 2001 From: Joris Gillis Date: Sun, 28 Jul 2024 17:14:09 +0200 Subject: [PATCH] make c compatible --- action.yml | 2 +- matlab/include/engine.h | 8 ++++++-- matlab/include/mex.h | 8 ++++++-- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/action.yml b/action.yml index 0bc5ee0..33b3f2e 100644 --- a/action.yml +++ b/action.yml @@ -9,7 +9,7 @@ runs: using: "composite" steps: - run: | - curl -OL https://github.com/casadi/mockups/releases/download/v79/mockups_${{ inputs.tag }}_Release.zip + curl -OL https://github.com/casadi/mockups/releases/download/v80/mockups_${{ inputs.tag }}_Release.zip unzip mockups_${{ inputs.tag }}_Release.zip -d mockups ls mockups ls mockups/cmake diff --git a/matlab/include/engine.h b/matlab/include/engine.h index 4f1fb03..b15fe71 100644 --- a/matlab/include/engine.h +++ b/matlab/include/engine.h @@ -1,8 +1,10 @@ #ifndef engine_H #define engine_H -extern "C" -{ +#ifdef __cplusplus +extern "C" { +#endif + typedef struct mxArray_tag mxArray; typedef struct engine Engine; @@ -14,6 +16,8 @@ extern "C" int engPutVariable(Engine *, const char *, const mxArray *); int engOutputBuffer(Engine *, char *, int); +#ifdef __cplusplus } +#endif #endif // engine_H diff --git a/matlab/include/mex.h b/matlab/include/mex.h index 501941f..df127bc 100644 --- a/matlab/include/mex.h +++ b/matlab/include/mex.h @@ -2,8 +2,10 @@ #define mex_H -extern "C" -{ +#ifdef __cplusplus +extern "C" { +#endif + typedef struct mxArray_tag mxArray; @@ -22,6 +24,8 @@ void mexLock(void); int mexAtExit(void (*)(void)); void mexMakeArrayPersistent(mxArray *); +#ifdef __cplusplus } +#endif #endif // mex_H