aboutsummaryrefslogtreecommitdiff
path: root/source/SmallVector.hpp
diff options
context:
space:
mode:
authorrtk0c <[email protected]>2022-04-25 20:22:07 -0700
committerrtk0c <[email protected]>2022-04-25 20:22:07 -0700
commit855da86feae1a5cc14dc2d486ccf115f484dbc2e (patch)
tree8284c6a6bdfb1a919eb1a22f466f4180a329c7f3 /source/SmallVector.hpp
parentd78a55de5003dbb040f1d1c369409e63a2c806d8 (diff)
Changeset: 16 Initial work on rendering sprites to screen
Diffstat (limited to 'source/SmallVector.hpp')
-rw-r--r--source/SmallVector.hpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/source/SmallVector.hpp b/source/SmallVector.hpp
index 9461800..e33a25d 100644
--- a/source/SmallVector.hpp
+++ b/source/SmallVector.hpp
@@ -36,6 +36,14 @@
# pragma warning(disable : 4267) // The compiler detected a conversion from size_t to a smaller type.
#endif
+#if __has_builtin(__builtin_expect) || defined(__GNUC__)
+# define LLVM_LIKELY(EXPR) __builtin_expect((bool)(EXPR), true)
+# define LLVM_UNLIKELY(EXPR) __builtin_expect((bool)(EXPR), false)
+#else
+# define LLVM_LIKELY(EXPR) (EXPR)
+# define LLVM_UNLIKELY(EXPR) (EXPR)
+#endif
+
template <typename IteratorT>
class iterator_range;