Skip to content

Commit

Permalink
Add DETAIL_ macros for Export.hh (#72)
Browse files Browse the repository at this point in the history
Signed-off-by: Shameek Ganguly <[email protected]>
  • Loading branch information
shameekganguly authored Feb 29, 2024
1 parent 67304ef commit da83348
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions skylark/gz_export_header.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,22 @@ def gz_export_header(name, lib_name, export_base, visibility, **kwargs):
#ifndef {export_base}_EXPORT_HH_
#define {export_base}_EXPORT_HH_
#ifndef DETAIL_{export_base}_VISIBLE
#define DETAIL_{export_base}_VISIBLE \
__attribute__ ((visibility("default")))
#endif
#ifndef DETAIL_{export_base}_HIDDEN
#define DETAIL_{export_base}_HIDDEN \
__attribute__ ((visibility("hidden")))
#endif
#ifndef {export_base}_VISIBLE
/// For {lib_name} developers: Apply this macro to {lib_name}
/// functions and classes which consumers of this library will need to be able
/// to call from their own programs or libraries.
#define {export_base}_VISIBLE \
__attribute__ ((visibility("default")))
DETAIL_{export_base}_VISIBLE
#endif
Expand All @@ -51,7 +61,7 @@ def gz_export_header(name, lib_name, export_base, visibility, **kwargs):
/// not tagged with {export_base}_VISIBLE, so this does not
/// generally need to be used.
#define {export_base}_HIDDEN \
__attribute__ ((visibility("hidden")))
DETAIL_{export_base}_HIDDEN
#endif
Expand Down

0 comments on commit da83348

Please sign in to comment.