From 4a935d829a6c1be05a69f13aed520072fb432cd8 Mon Sep 17 00:00:00 2001 From: Thomas Beutlich Date: Fri, 26 Jan 2024 22:39:16 +0100 Subject: [PATCH] Fix fseeko/ftello configuration --- .../BuildProjects/CMake/compiler_options.cmake | 4 ++++ Modelica/Resources/BuildProjects/CMake/src.cmake | 12 ++++++++++++ Modelica/Resources/C-Sources/ModelicaMatIO.c | 12 ------------ 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/Modelica/Resources/BuildProjects/CMake/compiler_options.cmake b/Modelica/Resources/BuildProjects/CMake/compiler_options.cmake index 01c152acfda..3d35e9cc142 100644 --- a/Modelica/Resources/BuildProjects/CMake/compiler_options.cmake +++ b/Modelica/Resources/BuildProjects/CMake/compiler_options.cmake @@ -1,5 +1,9 @@ include(CheckSymbolExists) check_symbol_exists(memcpy "string.h" HAVE_MEMCPY) +check_symbol_exists(fseeko "stdio.h" HAVE_FSEEKO) +check_symbol_exists(ftello "stdio.h" HAVE_FTELLO) +check_symbol_exists(fseeko64 "stdio.h" HAVE_FSEEKO64) +check_symbol_exists(ftello64 "stdio.h" HAVE_FTELLO64) include(CheckIncludeFile) check_include_file("dirent.h" HAVE_DIRENT_H) diff --git a/Modelica/Resources/BuildProjects/CMake/src.cmake b/Modelica/Resources/BuildProjects/CMake/src.cmake index f9573b9aedd..08ae2db61d5 100644 --- a/Modelica/Resources/BuildProjects/CMake/src.cmake +++ b/Modelica/Resources/BuildProjects/CMake/src.cmake @@ -22,6 +22,18 @@ endif() if(HAVE_MEMCPY) add_definitions(-DHAVE_MEMCPY) endif() +if(HAVE_FSEEKO) + add_definitions(-DHAVE_FSEEKO) +endif() +if(HAVE_FTELLO) + add_definitions(-HAVE_FTELLO) +endif() +if(HAVE_FSEEKO64) + add_definitions(-DHAVE_FSEEKO64) +endif() +if(HAVE_FTELLO64) + add_definitions(-DHAVE_FTELLO64) +endif() if(UNIX) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3 -Wno-attributes -fno-delete-null-pointer-checks") diff --git a/Modelica/Resources/C-Sources/ModelicaMatIO.c b/Modelica/Resources/C-Sources/ModelicaMatIO.c index 957d6be0e67..6296e534553 100644 --- a/Modelica/Resources/C-Sources/ModelicaMatIO.c +++ b/Modelica/Resources/C-Sources/ModelicaMatIO.c @@ -81,18 +81,6 @@ /* Extended sparse matrix data types */ /* #undef EXTENDED_SPARSE */ -/* Define to 1 if you have the `fseeko' function. */ -#undef HAVE_FSEEKO - -/* Define to 1 if you have the `ftello' function. */ -#undef HAVE_FTELLO - -/* Define to 1 if you have the `fseeko64' function. */ -#undef HAVE_FSEEKO64 - -/* Define to 1 if you have the `ftello64' function. */ -#undef HAVE_FTELLO64 - /* Define to 1 if you have the `_fseeki64' function. */ #if defined(_MSC_VER) && _MSC_VER >= 1400 #define HAVE__FSEEKI64 1