From 321cc1bf33c007a9f69853ea70307b373f115caa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20DAVID?= Date: Fri, 31 Mar 2023 10:02:08 +0200 Subject: scilab: detect version 2023 correctly --- Lib/scilab/scirun.swg | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) (limited to 'Lib') diff --git a/Lib/scilab/scirun.swg b/Lib/scilab/scirun.swg index 586d5f16f..481aac7ac 100644 --- a/Lib/scilab/scirun.swg +++ b/Lib/scilab/scirun.swg @@ -5,7 +5,6 @@ /* Scilab version macro */ #include "version.h" -#define SWIG_SCILAB_VERSION (SCI_VERSION_MAJOR * 100) + (SCI_VERSION_MINOR * 10) + SCI_VERSION_MAINTENANCE /* Scilab standard headers */ @@ -13,11 +12,11 @@ extern "C" { #endif #include "api_scilab.h" -#if SWIG_SCILAB_VERSION < 540 +#if SCI_VERSION_MAJOR < 5 || SCI_VERSION_MAJOR == 5 && SCI_VERSION_MINOR < 4 #define __USE_DEPRECATED_STACK_FUNCTIONS__ #include "stack-c.h" #endif -#if SWIG_SCILAB_VERSION < 600 +#if SCI_VERSION_MAJOR < 6 #include "MALLOC.h" #endif #include "Scierror.h" @@ -31,12 +30,12 @@ extern "C" { /* Gateway signature */ -#if SWIG_SCILAB_VERSION >= 600 -#define SWIG_GatewayParameters char* fname, void *pvApiCtx -#define SWIG_GatewayArguments fname, pvApiCtx -#else +#if SCI_VERSION_MAJOR < 6 #define SWIG_GatewayParameters char* fname, unsigned long fname_len #define SWIG_GatewayArguments fname, fname_len +# else +#define SWIG_GatewayParameters char* fname, void *pvApiCtx +#define SWIG_GatewayArguments fname, pvApiCtx #endif /* Function name management functions */ @@ -58,29 +57,29 @@ static void SWIG_Scilab_SetFuncName(char *funcName) { /* Api context management functions */ -#if SWIG_SCILAB_VERSION >= 600 +#if SCI_VERSION_MAJOR < 6 +#define SWIG_Scilab_SetApiContext(apiCtx) +#else static void *pvApiCtx = NULL; static void SWIG_Scilab_SetApiContext(void *apiCtx) { pvApiCtx = apiCtx; } -#else -#define SWIG_Scilab_SetApiContext(apiCtx) #endif /* Argument management functions */ -#if SWIG_SCILAB_VERSION >= 540 -#define SWIG_CheckInputArgument(pvApiCtx, minInputArgument, maxInputArgument) CheckInputArgument(pvApiCtx, minInputArgument, maxInputArgument) -#define SWIG_CheckInputArgumentAtLeast(pvApiCtx, minInputArgument) CheckInputArgumentAtLeast(pvApiCtx, minInputArgument) -#define SWIG_CheckOutputArgument(pvApiCtx, minOutputArgument, maxOutputArgument) CheckOutputArgument(pvApiCtx, minOutputArgument, maxOutputArgument) -#define SWIG_NbInputArgument(pvApiCtx) nbInputArgument(pvApiCtx) -#define SWIG_AssignOutputArgument(pvApiCtx, outputArgumentPos, argumentPos) AssignOutputVariable(pvApiCtx, outputArgumentPos) = argumentPos -#else +#if SCI_VERSION_MAJOR < 5 || SCI_VERSION_MAJOR == 5 && SCI_VERSION_MINOR < 4 #define SWIG_CheckInputArgument(pvApiCtx, minInputArgument, maxInputArgument) CheckRhs(minInputArgument, maxInputArgument) #define SWIG_CheckInputArgumentAtLeast(pvApiCtx, minInputArgument) CheckRhs(minInputArgument, 256) #define SWIG_CheckOutputArgument(pvApiCtx, minOutputArgument, maxOutputArgument) CheckLhs(minOutputArgument, maxOutputArgument) #define SWIG_NbInputArgument(pvApiCtx) Rhs #define SWIG_AssignOutputArgument(pvApiCtx, outputArgumentPos, argumentPos) LhsVar(outputArgumentPos) = argumentPos +#else +#define SWIG_CheckInputArgument(pvApiCtx, minInputArgument, maxInputArgument) CheckInputArgument(pvApiCtx, minInputArgument, maxInputArgument) +#define SWIG_CheckInputArgumentAtLeast(pvApiCtx, minInputArgument) CheckInputArgumentAtLeast(pvApiCtx, minInputArgument) +#define SWIG_CheckOutputArgument(pvApiCtx, minOutputArgument, maxOutputArgument) CheckOutputArgument(pvApiCtx, minOutputArgument, maxOutputArgument) +#define SWIG_NbInputArgument(pvApiCtx) nbInputArgument(pvApiCtx) +#define SWIG_AssignOutputArgument(pvApiCtx, outputArgumentPos, argumentPos) AssignOutputVariable(pvApiCtx, outputArgumentPos) = argumentPos #endif typedef int SwigSciObject; -- cgit v1.2.1