From 61d8bcc4f631c8b3bd8a14a2a8bf68d7c0749809 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 18 May 2020 12:47:18 +0000 Subject: If Tcl is built with external libtommath (TCL_WITH_EXTERNAL_TOMMATH is defined), do the tests with the external libtommath too. Also, don't try to include if BN_H_ is already defined. --- generic/tclTest.c | 8 +++++++- generic/tclTomMath.h | 10 ++++++---- win/tclWinTest.c | 6 +++++- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/generic/tclTest.c b/generic/tclTest.c index a6c3b83..8cca744 100644 --- a/generic/tclTest.c +++ b/generic/tclTest.c @@ -20,7 +20,11 @@ # define USE_TCL_STUBS #endif #include "tclInt.h" -#include "tclTomMath.h" +#ifdef TCL_WITH_EXTERNAL_TOMMATH +# include "tommath.h" +#else +# include "tclTomMath.h" +#endif #include "tclOO.h" #include @@ -446,9 +450,11 @@ Tcltest_Init( if (Tcl_InitStubs(interp, "8.5-", 0) == NULL) { return TCL_ERROR; } +#ifndef TCL_WITH_EXTERNAL_TOMMATH if (Tcl_TomMath_InitStubs(interp, "8.5-") == NULL) { return TCL_ERROR; } +#endif if (Tcl_OOInitStubs(interp) == NULL) { return TCL_ERROR; } diff --git a/generic/tclTomMath.h b/generic/tclTomMath.h index e9257a0..0d2d320 100644 --- a/generic/tclTomMath.h +++ b/generic/tclTomMath.h @@ -2,13 +2,15 @@ #define BN_TCL_H_ #ifdef MP_NO_STDINT -#ifdef HAVE_STDINT_H -# include +# ifdef HAVE_STDINT_H +# include #else -# include "../compat/stdint.h" +# include "../compat/stdint.h" +# endif #endif +#ifndef BN_H_ /* If BN_H_ already defined, don't try to include tommath.h again. */ +# include "tommath.h" #endif -#include "tommath.h" #include "tclTomMathDecls.h" #endif diff --git a/win/tclWinTest.c b/win/tclWinTest.c index 5841509..91a3010 100644 --- a/win/tclWinTest.c +++ b/win/tclWinTest.c @@ -13,7 +13,11 @@ # define USE_TCL_STUBS #endif #include "tclInt.h" -#include "tclTomMath.h" +#ifdef TCL_WITH_EXTERNAL_TOMMATH +# include "tommath.h" +#else +# include "tclTomMath.h" +#endif /* * For TestplatformChmod on Windows -- cgit v0.12