Implement UPB_UNREACHABLE for Visual C++.

See https://stackoverflow.com/a/60802890.

PiperOrigin-RevId: 493726837
pull/13171/head
Protobuf Team Bot 2 years ago committed by Copybara-Service
parent 0980a7b418
commit 79abc9f1a1
  1. 6
      upb/port/def.inc

@ -171,6 +171,12 @@
#if defined(__GNUC__) || defined(__clang__)
#define UPB_UNREACHABLE() do { assert(0); __builtin_unreachable(); } while(0)
#elif defined(_MSC_VER)
#define UPB_UNREACHABLE() \
do { \
assert(0); \
__assume(0); \
} while (0)
#else
#define UPB_UNREACHABLE() do { assert(0); } while(0)
#endif

Loading…
Cancel
Save