diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2018-03-04 15:24:52 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2018-03-04 15:24:52 +0100 |
commit | 3d226e63b07b99a7ff00ea1da0ae6338b01ef5c9 (patch) | |
tree | 010e7ddfc36ca3a07a1757a8d12d724dba8b7514 | |
parent | 925f22933f1a6f96d3a7ed9cab286b8db44b84f6 (diff) |
logic/pipeline: use `likely' equiv for MSVC
-rw-r--r-- | logic/pipeline.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/logic/pipeline.cpp b/logic/pipeline.cpp index 05719351..0d9c2021 100644 --- a/logic/pipeline.cpp +++ b/logic/pipeline.cpp @@ -236,12 +236,15 @@ bool maybe_nan(const char* text, const char* fun, int line, const xs&... vals) return false; } - -#define nan_check(...) \ - do \ - { \ - if (maybe_nan(#__VA_ARGS__, OTR_FUNNAME, __LINE__, __VA_ARGS__)) \ - goto error; \ +// for MSVC `else' is like `unlikely' for GNU + +#define nan_check(...) \ + do \ + { \ + if (likely(!maybe_nan(#__VA_ARGS__, OTR_FUNNAME, __LINE__, __VA_ARGS__))) \ + (void)0; \ + else \ + goto error; \ } while (false) bool pipeline::maybe_enable_center_on_tracking_started() |