From b913ec98473367b86d40e112b93ab9ccabe55666 Mon Sep 17 00:00:00 2001 From: Thomas Beutlich Date: Sun, 27 Oct 2024 12:02:33 +0100 Subject: [PATCH] Fix MSVC build error and update CMake configuration --- Modelica/Resources/BuildProjects/CMake/src.cmake | 4 ++++ Modelica/Resources/BuildProjects/CMake/test.cmake | 1 + Modelica/Resources/C-Sources/ModelicaTime.c | 5 ----- Modelica/Resources/C-Sources/ModelicaTime.h | 4 +++- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Modelica/Resources/BuildProjects/CMake/src.cmake b/Modelica/Resources/BuildProjects/CMake/src.cmake index 2a2a7e9002..1a3d3e37ae 100644 --- a/Modelica/Resources/BuildProjects/CMake/src.cmake +++ b/Modelica/Resources/BuildProjects/CMake/src.cmake @@ -70,9 +70,13 @@ set(EXTC_SOURCES "${MODELICA_SOURCE_DIR}/ModelicaRandom.h" "${MODELICA_SOURCE_DIR}/ModelicaStrings.c" "${MODELICA_SOURCE_DIR}/ModelicaStrings.h" + "${MODELICA_SOURCE_DIR}/ModelicaTime.c" + "${MODELICA_SOURCE_DIR}/ModelicaTime.h" "${MODELICA_SOURCE_DIR}/gconstructor.h" + "${MODELICA_SOURCE_DIR}/repl_str.h" "${MODELICA_SOURCE_DIR}/stdint_msvc.h" "${MODELICA_SOURCE_DIR}/stdint_wrap.h" + "${MODELICA_SOURCE_DIR}/strptime.h" "${MODELICA_SOURCE_DIR}/uthash.h" "${MODELICA_SOURCE_DIR}/win32_dirent.c" "${MODELICA_SOURCE_DIR}/win32_dirent.h" diff --git a/Modelica/Resources/BuildProjects/CMake/test.cmake b/Modelica/Resources/BuildProjects/CMake/test.cmake index 0e57ddb6c4..d94159ac40 100644 --- a/Modelica/Resources/BuildProjects/CMake/test.cmake +++ b/Modelica/Resources/BuildProjects/CMake/test.cmake @@ -7,6 +7,7 @@ if(BUILD_TESTING) set(MODELICA_TESTS FileSystem ModelicaStrings + ModelicaTime Streams Tables TablesFromCsvFile diff --git a/Modelica/Resources/C-Sources/ModelicaTime.c b/Modelica/Resources/C-Sources/ModelicaTime.c index e53822ace4..045d28e0d4 100644 --- a/Modelica/Resources/C-Sources/ModelicaTime.c +++ b/Modelica/Resources/C-Sources/ModelicaTime.c @@ -29,11 +29,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -// TODO: Remove when ModelicaTime.c will become part of ModelicaExternalC -#if defined(DYMOSIM) -#pragma once -#endif - #include "ModelicaTime.h" #include "ModelicaUtilities.h" #include "strptime.h" diff --git a/Modelica/Resources/C-Sources/ModelicaTime.h b/Modelica/Resources/C-Sources/ModelicaTime.h index 912f4bb0f2..59cbbeb3d5 100644 --- a/Modelica/Resources/C-Sources/ModelicaTime.h +++ b/Modelica/Resources/C-Sources/ModelicaTime.h @@ -1,6 +1,6 @@ /* ModelicaTime.h - External functions header for Modelica.Utilities.Time - Copyright (C) 2020, Modelica Association and contributors + Copyright (C) 2020-2024, Modelica Association and contributors All rights reserved. Redistribution and use in source and binary forms, with or without @@ -42,6 +42,8 @@ #ifndef MODELICA_TIME_H_ #define MODELICA_TIME_H_ +#include + #if !defined(MODELICA_EXPORT) #if defined(__cplusplus) #define MODELICA_EXPORT extern "C"