Skip to content

Commit

Permalink
Redefine instrumentation macros for MSVC
Browse files Browse the repository at this point in the history
  • Loading branch information
Bronek committed Dec 4, 2024
1 parent 1653844 commit eb9464c
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions include/xrpl/beast/utility/instrumentation.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,18 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#ifdef NDEBUG
#error "Antithesis instrumentation requires Debug build"
#endif
#include <antithesis_sdk.h>
#else
#define NO_ANTITHESIS_SDK
#define ANTITHESIS_SDK_ALWAYS_POLYFILL(cond, message, ...) \
assert((message) && (cond))
// Macros below are copied from antithesis_sdk.h and slightly simplified
// The duplication is because Visual Studio 2019 cannot compile this header
// even with the option -Zc:__cplusplus added.
#define ALWAYS(cond, message, ...) assert((message) && (cond))
#define ALWAYS_OR_UNREACHABLE(cond, message, ...) assert((message) && (cond))
#define SOMETIMES(cond, message, ...)
#define REACHABLE(message, ...)
#define UNREACHABLE(message, ...) assert((message) && false)
#endif

// Define instrumentation macros ALWAYS ALWAYS_OR_UNREACHABLE UNREACHABLE etc.
#include <antithesis_sdk.h>

#define XRPL_ASSERT ALWAYS_OR_UNREACHABLE

// How to use the instrumentation macros:
Expand Down

0 comments on commit eb9464c

Please sign in to comment.