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

Describe common ways of using ModelicaUtilities.h #3455

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

henrikt-ma
Copy link
Collaborator

This was factored out of #3452, as promised in #3452 (comment).

In addition to examples and other non-normative text, this PR makes clear that #include "ModelicaUtilities.h" shall work inside an Include annotation.

@henrikt-ma henrikt-ma requested a review from HansOlsson December 7, 2023 23:03
@HansOlsson HansOlsson added this to the 2024-2 milestone Mar 25, 2024
The tool must ensure that the header is found by \lstinline[language=C]!#include "ModelicaUtilities.h"! within an \lstinline!Include! annotation (see \cref{annotations-for-external-libraries-and-include-files}); no \lstinline!IncludeDirectory! annotation is needed.

\begin{example}
The following usage patterns are common:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is too much text where real examples seem more useful to me. Might be a good idea to have all three patterns available as proper examples, e. g. in the ModelicaCompliance library or ModelicaReference library or any other dedicated library.

@henrikt-ma henrikt-ma requested a review from HansOlsson March 25, 2025 21:40
\end{example}

\begin{nonnormative}
When building external libraries, it is not possible to rely on the tool mechanism that provides \filename{ModelicaUtilities.h} for \lstinline!Include! annotations.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But I could add IncludeDirectory="modelica://Modelica/Resources/C-Sources" to my annotations of my external library project such that ModelicaUtilities.h is found on the include path.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This remark is not about building code in the annotations of a Modelica external function. This is about building an external library with no Modelica code or concepts involved, with the intent of later linking with the library using the Library-annotation of a Modelica external function.

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.

3 participants