[vlc-commits] vlc_common: Provide an unreachable() implementation for MSVC
Hugo Beauzée-Luyssen
git at videolan.org
Mon Jan 25 17:47:02 UTC 2021
vlc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Fri Dec 18 13:04:14 2020 +0100| [626a5d9a16b44ff01bb6f25b76872f1c4bd5bab0] | committer: Hugo Beauzée-Luyssen
vlc_common: Provide an unreachable() implementation for MSVC
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=626a5d9a16b44ff01bb6f25b76872f1c4bd5bab0
---
include/vlc_common.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/include/vlc_common.h b/include/vlc_common.h
index d65a076d45..f62ff86d04 100644
--- a/include/vlc_common.h
+++ b/include/vlc_common.h
@@ -203,6 +203,10 @@
# define likely(p) __builtin_expect(!!(p), 1)
# define unlikely(p) __builtin_expect(!!(p), 0)
# define unreachable() __builtin_unreachable()
+#elif defined(_MSC_VER)
+# define likely(p) (!!(p))
+# define unlikely(p) (!!(p))
+# define unreachable() (__assume(0))
#else
/**
* Predicted true condition
More information about the vlc-commits
mailing list