modelica / ModelicaStandardLibrary

Free (standard conforming) library to model mechanical (1D/3D), electrical (analog, digital, machines), magnetic, thermal, fluid, control systems and hierarchical state machines. Also numerical functions and functions for strings, files and streams are included.
https://doc.modelica.org
BSD 3-Clause "New" or "Revised" License
453 stars 165 forks source link

C code uses macros specified in internal/hidden ModelicaUtilities.h #4280

Closed maltelenz closed 5 months ago

maltelenz commented 5 months ago

The external C code in MSL uses macros. Example:

https://github.com/modelica/ModelicaStandardLibrary/blob/d0ff9bceb68621e4fc56f44a335e403947fd3c78/Modelica/Resources/C-Sources/ModelicaInternal.c#L150

These macros are defined in some ModelicaUtilities.h which has to be assumed is internal since it is in the .CI folder:

https://github.com/modelica/ModelicaStandardLibrary/blob/d0ff9bceb68621e4fc56f44a335e403947fd3c78/.CI/Test/ModelicaUtilities.h#L63-L127

However, as a tool vendor, I expect to provide my own ModelicaUtilities.h, which fulfills only the requirements given in the specification for such a file.

Should these macro definitions be moved out to a different .h in Modelica/Resources/C-Sources?

beutlich commented 5 months ago

Glad you reported this after #3871 got merged. Needs to be addressed before MSL v4.1.0 is released.