-
Notifications
You must be signed in to change notification settings - Fork 297
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Limit set of symbols exported from libdlt
Summary: This commit deals with issues potentially introduced in code linked to shared libdlt. The library previously exported all symbols by default, up to ~60 of which were not prefixed 'dlt*' and could conflict with symbols in the consumer code. After applying this commit only symbols prefixed 'dlt*' can be observed using $ nm --dynamic --defined-only ./build/src/lib/libdlt.so | cut -f3 -d' ' | sort which drastically reduces the chance of such conflicts. Brief: - explicit symbol export using DLT_EXPORT macro as provided by CMake's GenerateExportHeader module - rename get_filename_ext to dlt_get_filename_ext - rename getFileSerialNumber to dlt_get_file_serial_number - hide dlt_daemon's original main() in unit tests to avoid multiple definition on some platforms - add CMake 3.12's GenerateExportHeader to repository for backward-compatibility with pre-3.12 CMake (i.e. Ubuntu 18.04)
- Loading branch information
Showing
21 changed files
with
842 additions
and
342 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
|
||
#ifndef @INCLUDE_GUARD_NAME@ | ||
#define @INCLUDE_GUARD_NAME@ | ||
|
||
#ifdef @STATIC_DEFINE@ | ||
# define @EXPORT_MACRO_NAME@ | ||
# define @NO_EXPORT_MACRO_NAME@ | ||
#else | ||
# ifndef @EXPORT_MACRO_NAME@ | ||
# ifdef @EXPORT_IMPORT_CONDITION@ | ||
/* We are building this library */ | ||
# define @EXPORT_MACRO_NAME@ @DEFINE_EXPORT@ | ||
# else | ||
/* We are using this library */ | ||
# define @EXPORT_MACRO_NAME@ @DEFINE_IMPORT@ | ||
# endif | ||
# endif | ||
|
||
# ifndef @NO_EXPORT_MACRO_NAME@ | ||
# define @NO_EXPORT_MACRO_NAME@ @DEFINE_NO_EXPORT@ | ||
# endif | ||
#endif | ||
|
||
#ifndef @DEPRECATED_MACRO_NAME@ | ||
# define @DEPRECATED_MACRO_NAME@ @DEFINE_DEPRECATED@ | ||
#endif | ||
|
||
#ifndef @DEPRECATED_MACRO_NAME@_EXPORT | ||
# define @DEPRECATED_MACRO_NAME@_EXPORT @EXPORT_MACRO_NAME@ @DEPRECATED_MACRO_NAME@ | ||
#endif | ||
|
||
#ifndef @DEPRECATED_MACRO_NAME@_NO_EXPORT | ||
# define @DEPRECATED_MACRO_NAME@_NO_EXPORT @NO_EXPORT_MACRO_NAME@ @DEPRECATED_MACRO_NAME@ | ||
#endif | ||
|
||
#if @DEFINE_NO_DEPRECATED@ /* DEFINE_NO_DEPRECATED */ | ||
# ifndef @NO_DEPRECATED_MACRO_NAME@ | ||
# define @NO_DEPRECATED_MACRO_NAME@ | ||
# endif | ||
#endif | ||
@CUSTOM_CONTENT@ | ||
#endif /* @INCLUDE_GUARD_NAME@ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.