Skip to content

Commit

Permalink
Add full UNF_EXPORTS
Browse files Browse the repository at this point in the history
  • Loading branch information
mati-nvidia committed Dec 20, 2023
1 parent 272e598 commit c1aced4
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
add_compile_definitions(UNF_EXPORTS)

add_library(unf
unf/broker.cpp
unf/capturePredicate.cpp
Expand Down
19 changes: 17 additions & 2 deletions src/unf/api.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,22 @@

#include "pxr/base/arch/export.h"

#define UNF_API ARCH_EXPORT
#define UNF_LOCAL ARCH_HIDDEN
#if defined(UNF_STATIC)
# define UNF_API
# define UNF_API_TEMPLATE_CLASS(...)
# define UNF_API_TEMPLATE_STRUCT(...)
# define UNF_LOCAL
#else
# if defined(UNF_EXPORTS)
# define UNF_API ARCH_EXPORT
# define UNF_API_TEMPLATE_CLASS(...) ARCH_EXPORT_TEMPLATE(class, __VA_ARGS__)
# define UNF_API_TEMPLATE_STRUCT(...) ARCH_EXPORT_TEMPLATE(struct, __VA_ARGS__)
# else
# define UNF_API ARCH_IMPORT
# define UNF_API_TEMPLATE_CLASS(...) ARCH_IMPORT_TEMPLATE(class, __VA_ARGS__)
# define UNF_API_TEMPLATE_STRUCT(...) ARCH_IMPORT_TEMPLATE(struct, __VA_ARGS__)
# endif
# define UNF_LOCAL ARCH_HIDDEN
#endif

#endif
4 changes: 2 additions & 2 deletions src/unf/broker.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ class Broker : public PXR_NS::TfRefBase, public PXR_NS::TfWeakBase {
/// \note
/// The associated stage will be used as sender.
template <class UnfNotice, class... Args>
UNF_API void Send(Args&&... args);
void Send(Args&&... args);

/// \brief
/// Send a UnfNotice::StageNotice notice via the broker.
Expand All @@ -148,7 +148,7 @@ class Broker : public PXR_NS::TfRefBase, public PXR_NS::TfWeakBase {
///
/// This will call the Dispatcher::Register method.
template <class T>
UNF_API void AddDispatcher();
void AddDispatcher();

/// \brief
/// Un-register broker.
Expand Down

0 comments on commit c1aced4

Please sign in to comment.