From f272216ae30f6cef19eb152c97c8e834b7ef393e Mon Sep 17 00:00:00 2001 From: NAKATA Maho Date: Mon, 6 Apr 2026 13:13:21 +0900 Subject: [PATCH] lapack/laed3: fix MinGW build for slaed3 common_interface.h declares slamc3 as returning FLOATRET when NEED_F2CCONV is enabled, but laed3_single.c and laed3_parallel.c redeclared LAMC3 as returning FLOAT. This causes conflicting-type errors in MinGW builds. Use FLOATRET for the local LAMC3 prototype so it matches the shared declaration. Also undefine the Windows max macro before the local max definition in laed3_parallel.c to avoid macro redefinition warnings. --- lapack/laed3/laed3_parallel.c | 5 ++++- lapack/laed3/laed3_single.c | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lapack/laed3/laed3_parallel.c b/lapack/laed3/laed3_parallel.c index e02567b699..c6749144cf 100644 --- a/lapack/laed3/laed3_parallel.c +++ b/lapack/laed3/laed3_parallel.c @@ -33,6 +33,9 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include "common.h" +#ifdef max +#undef max +#endif #define max(a,b) ((a) > (b) ? (a) : (b)) #define copysign(x,y) ((y) < 0 ? ((x) < 0 ? (x) : -(x)) : ((x) < 0 ? -(x) : (x))) @@ -54,7 +57,7 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define LASET BLASFUNC(slaset) #endif -FLOAT LAMC3(FLOAT *, FLOAT *); +FLOATRET LAMC3(FLOAT *, FLOAT *); void LAED4(blasint *, blasint *, FLOAT *, FLOAT *, FLOAT *, FLOAT *, FLOAT *, blasint *); void LACPY(char *, blasint *, blasint *, FLOAT *, blasint *, FLOAT *, blasint *); void LASET(char *, blasint *, blasint *, FLOAT *, FLOAT *, FLOAT *, blasint *); diff --git a/lapack/laed3/laed3_single.c b/lapack/laed3/laed3_single.c index b21bb99300..99871f1855 100644 --- a/lapack/laed3/laed3_single.c +++ b/lapack/laed3/laed3_single.c @@ -53,7 +53,7 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define LASET BLASFUNC(slaset) #endif -FLOAT LAMC3(FLOAT *, FLOAT *); +FLOATRET LAMC3(FLOAT *, FLOAT *); void LAED4(blasint *, blasint *, FLOAT *, FLOAT *, FLOAT *, FLOAT *, FLOAT *, blasint *); void LACPY(char *, blasint *, blasint *, FLOAT *, blasint *, FLOAT *, blasint *); void LASET(char *, blasint *, blasint *, FLOAT *, FLOAT *, FLOAT *, blasint *);