Skip to content

Commit

Permalink
Update precompiler definitions check
Browse files Browse the repository at this point in the history
  • Loading branch information
sashacmc committed Jan 29, 2025
1 parent 6e8ec5b commit fd62ea0
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
4 changes: 2 additions & 2 deletions examples/universal/z_pub.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ int _main(int argc, char **argv) {
.named_value({"k", "key"}, "KEY_EXPRESSION", "Key expression to publish to (string)", default_keyexpr)
.named_value({"p", "payload"}, "PAYLOAD", "Payload to publish (string)", default_value)
.named_value({"a", "attach"}, "ATTACHMENT", "Attachment to add to each put (string)", "")
#if defined(Z_FEATURE_UNSTABLE_API) && defined(ZENOHCXX_ZENOHC) || Z_FEATURE_MATCHING == 1
#if defined(Z_FEATURE_UNSTABLE_API) && (defined(ZENOHCXX_ZENOHC) || Z_FEATURE_MATCHING == 1)
.named_flag({"add-matching-listener"}, "Add matching listener")
#endif
.run();
Expand All @@ -56,7 +56,7 @@ int _main(int argc, char **argv) {

std::cout << "Declaring Publisher on '" << keyexpr << "'..." << std::endl;
auto pub = session.declare_publisher(KeyExpr(keyexpr));
#if defined(Z_FEATURE_UNSTABLE_API) && defined(ZENOHCXX_ZENOHC) || Z_FEATURE_MATCHING == 1
#if defined(Z_FEATURE_UNSTABLE_API) && (defined(ZENOHCXX_ZENOHC) || Z_FEATURE_MATCHING == 1)
if (args.flag("add-matching-listener")) {
pub.declare_background_matching_listener(
[](const MatchingStatus &s) {
Expand Down
4 changes: 2 additions & 2 deletions examples/universal/z_querier.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ int _main(int argc, char **argv) {
.named_value({"t", "target"}, "TARGET", "Query target (BEST_MATCHING | ALL | ALL_COMPLETE)",
"BEST_MATCHING")
.named_value({"o", "timeout"}, "TIMEOUT", "Timeout in ms (number)", "10000")
#if defined(ZENOHCXX_ZENOHC) && defined(Z_FEATURE_UNSTABLE_API) || Z_FEATURE_MATCHING == 1
#if defined(Z_FEATURE_UNSTABLE_API) && (defined(ZENOHCXX_ZENOHC) || Z_FEATURE_MATCHING == 1)
.named_flag({"add-matching-listener"}, "Add matching listener")
#endif
.run();
Expand All @@ -53,7 +53,7 @@ int _main(int argc, char **argv) {
options.timeout_ms = timeout_ms;
auto querier = session.declare_querier(selector.key_expr, std::move(options));

#if defined(ZENOHCXX_ZENOHC) && defined(Z_FEATURE_UNSTABLE_API) || Z_FEATURE_MATCHING == 1
#if defined(Z_FEATURE_UNSTABLE_API) && (defined(ZENOHCXX_ZENOHC) || Z_FEATURE_MATCHING == 1)
if (args.flag("add-matching-listener")) {
querier.declare_background_matching_listener(
[](const MatchingStatus &s) {
Expand Down
6 changes: 4 additions & 2 deletions include/zenoh/api/publisher.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@
#include "interop.hxx"
#include "keyexpr.hxx"
#include "timestamp.hxx"
#if defined(ZENOHCXX_ZENOHC) && defined(Z_FEATURE_UNSTABLE_API)
#if defined(Z_FEATURE_UNSTABLE_API) && (defined(ZENOHCXX_ZENOHC) || Z_FEATURE_MATCHING == 1)
#include "matching.hxx"
#endif
#if defined(ZENOHCXX_ZENOHC) && defined(Z_FEATURE_UNSTABLE_API)
#include "source_info.hxx"
#endif
#include <optional>
Expand Down Expand Up @@ -145,7 +147,7 @@ class Publisher : public Owned<::z_owned_publisher_t> {
}
#endif

#if defined(ZENOHCXX_ZENOHC) && defined(Z_FEATURE_UNSTABLE_API) || Z_FEATURE_MATCHING == 1
#if defined(Z_FEATURE_UNSTABLE_API) && (defined(ZENOHCXX_ZENOHC) || Z_FEATURE_MATCHING == 1)
/// @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future
/// release.
/// @brief Construct matching listener, registering a callback for notifying subscribers matching with a given
Expand Down
6 changes: 4 additions & 2 deletions include/zenoh/api/querier.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@
#include "interop.hxx"
#include "keyexpr.hxx"
#include "reply.hxx"
#if defined(ZENOHCXX_ZENOHC) && defined(Z_FEATURE_UNSTABLE_API)
#if defined(Z_FEATURE_UNSTABLE_API) && (defined(ZENOHCXX_ZENOHC) || Z_FEATURE_MATCHING == 1)
#include "matching.hxx"
#endif
#if defined(ZENOHCXX_ZENOHC) && defined(Z_FEATURE_UNSTABLE_API)
#include "source_info.hxx"
#endif
#include <optional>
Expand Down Expand Up @@ -150,7 +152,7 @@ class Querier : public Owned<::z_owned_querier_t> {
}
#endif

#if defined(ZENOHCXX_ZENOHC) && defined(Z_FEATURE_UNSTABLE_API) || Z_FEATURE_MATCHING == 1
#if defined(Z_FEATURE_UNSTABLE_API) && (defined(ZENOHCXX_ZENOHC) || Z_FEATURE_MATCHING == 1)
/// @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future
/// release.
/// @brief Construct matching listener, registering a callback for notifying queryables matching with a given
Expand Down

0 comments on commit fd62ea0

Please sign in to comment.