Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change to proper function declarations for ModelicaUtilities.h #3652

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

HansOlsson
Copy link
Collaborator

So that they are not mistaken for the start of functions definitions.

As discussed in modelica/ModelicaStandardLibrary#4484 (comment) I think we should use function declarations when we discuss the contents of a header-file and not something that is the start of either a function definition or a function declaration.

Obviously they will be defined somewhere, but not in the header-file.
(I didn't change the tables, as they look like function calls.)

So that they are not mistaken for the start of functions definitions.
@fedetftpolimi
Copy link

fedetftpolimi commented Feb 14, 2025

I have mixed feelings about this, so I thought about it for a while, and in the end I am not so positive about stating in the standard that ModelicaUtilities.h must contain function declarations.

Sure, the current version of ModelicaUtilities.h does contain function declarations, so this change seems innocuous.

However, we still have a lot of unresolved issues (that I don't think is a good idea to address in time for 4.1.0), such as how to make those functions callable from shared libraries, or at compile time in a portable way across all tools. What if it turns out that to overcome the problems with Windows DLLs it is beneficial to declare them as inline functions or even macros? I'm thinking about using the mwe importer.h code I proposed a while ago, or because it turns out that the only possible portable implementation is to retrieve a function pointer and call into it, and an inline function can take care of this task?

I think what we should do for 4.1.0 is to state that a ModelicaUtilities.h should exist in the MSL and provide the current best version we have of that file. That would be the first step in the right direction.

Then, we must follow-up with actually making the interface work consistently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants