Commit 1136fec
Martin Belanger
libnvme: annotate public API symbols with __public
Add compiler_attributes.h defining two GCC visibility macros:
__public (__attribute__((visibility("default"))))
__weak (__attribute__((weak)))
Annotate all functions exported via libnvme.ld, libnvmf.ld, and
accessors.ld with __public. This prepares libnvme for builds with
-fvisibility=hidden, ensuring internal symbols are hidden by default
and only explicitly annotated functions form the public ABI.
Each affected .c file now includes compiler_attributes.h and marks
the relevant function definitions with __public. The accessor generator
has also been updated to emit __public, so future regenerations remain
consistent.
As a small related cleanup, __weak was introduced in
compiler_attributes.h and applied where needed. While not strictly part
of the main change, it naturally fits alongside the new attribute
definitions and keeps related compiler annotations consolidated.
Signed-off-by: Martin Belanger <martin.belanger@dell.com>1 parent a19cf14 commit 1136fec
18 files changed
Lines changed: 629 additions & 408 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
| 99 | + | |
99 | 100 | | |
100 | 101 | | |
101 | 102 | | |
| |||
0 commit comments