-
Notifications
You must be signed in to change notification settings - Fork 936
starter text for declspec description #10770
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
Changes from 4 commits
e59ac19
fcd79bc
ebb496c
fba4495
dda0abb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,30 @@ | ||||||||||
| Source code: Symbol visibility | ||||||||||
| ============================== | ||||||||||
|
|
||||||||||
| The ``*_DECLSPEC`` macros provide a method to annotate symbols to indicate | ||||||||||
| their intended visibility when compiling dynamically shared object files | ||||||||||
| (e.g., `libmpi.so`). | ||||||||||
|
|
||||||||||
| The macros are defined on a per project basis: | ||||||||||
|
|
||||||||||
| * Open MPI: ``OMPI_DECLSPEC``, ``OMPI_MODULE_DECLSPEC`` | ||||||||||
| * Open PAL: ``OPAL_DECLSPEC``, ``OPAL_MODULE_DECLSPEC`` | ||||||||||
| * OpenSHMEM: ``OSHMEM_DECLSPEC``, ``OSHMEM_MODULE_DECLSPEC`` | ||||||||||
|
|
||||||||||
| The macros expand to the appropriate compiler and platform flags for marking | ||||||||||
| whether a symbol should be explicitly made public in the target project's | ||||||||||
| library namespace. This is related to the Windows `__declspec <https://docs.microsoft.com/en-us/cpp/cpp/declspec?view=msvc-170>`_. | ||||||||||
|
|
||||||||||
| The ``*_DECLSPEC`` attribute is used to declare that the developer wants a | ||||||||||
| symbol to be usable outside of that library/DSO. For example, | ||||||||||
|
||||||||||
| The ``*_DECLSPEC`` attribute is used to declare that the developer wants a | |
| symbol to be usable outside of that library/DSO. For example, | |
| The ``*_DECLSPEC`` attributes are used to declare that a | |
| symbol is to be visible outside of that library/DSO's scope. For example, |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at the code today, I wonder if the MODULE_DECLSPEC is left over from when we supported Windows. Today, DECLSPEC and MODULE_DECLSPEC resolve to the same back-end compiler attribute. I have a super-dim recollection that they might have been different on Windows, and we therefore needed 2 different macros.
But since we've long-since stopped supporting Windows, should we ditch the MODULE_DECLSPEC macro?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 for removing MODULE_DECLSPEC if it is redundant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just checked Open MPI v1.0.0, and I confirm: in Windows, there was a difference between exporting the component symbol and exporting other symbols.
Given that we don't support native Windows builds any more, I think we should remove the distinction.
@naughtont3 I can make a PR for the code change if you want to update the text.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR to remove MODULE_DECLSPEC: #10774
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: extra blank line at the end of the file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.