Skip to content

Commit

Permalink
ReturnValue: Fix definitions of DISABLE_BOOL_* macros and make name y…
Browse files Browse the repository at this point in the history
…arp specific
  • Loading branch information
traversaro authored Jan 31, 2025
1 parent cc2374c commit 5164b76
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/libYARP_dev/src/yarp/dev/ReturnValue.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
// If enabled, a bool value cannot be automatically converted to ReturnValue
// In this way, the developer can check if some old devices/interfaces do unwanted automatic
// conversions and fix them.
#define DISABLE_BOOL_INPUT
// #define YARP_RETURN_VALUE_DISABLE_BOOL_INPUT

// The following macro is used for testing/development purposes only, but it must be generally not enabled.
// If enabled, a ReturnValue cannot be automatically converted to bool unless explicitly requested
// using the bool() operator.
// If enabled, it will break backward compatibility with user-application code.
// #define DISABLE_BOOL_OUTPUT
// #define YARP_RETURN_VALUE_DISABLE_BOOL_OUTPUT

namespace yarp::dev {

Expand Down Expand Up @@ -54,12 +54,12 @@ class YARP_dev_API ReturnValue : public yarp::os::Portable
ReturnValue(const ReturnValue& other) = default;
ReturnValue& operator && (const ReturnValue& other);
ReturnValue& operator &= (const ReturnValue& other);
#ifndef DISABLE_BOOL_INPUT
#ifndef YARP_RETURN_VALUE_DISABLE_BOOL_INPUT
ReturnValue& operator=(const bool& bool_val);
#endif
bool operator == (const return_code& code) const;
std::string toString();
#ifndef DISABLE_BOOL_OUTPUT
#ifndef YARP_RETURN_VALUE_DISABLE_BOOL_OUTPUT
operator bool() const;
#else
explicit operator bool const();
Expand Down

0 comments on commit 5164b76

Please sign in to comment.