Skip to content

Commit fb08e43

Browse files
committed
Define likely() and unlikely() on any compiler with __has_builtin(__builtin_expect))
Newer versions of MSVC apparently support this.
1 parent f46c831 commit fb08e43

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/steamnetworkingsockets/steamnetworkingsockets_internal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ struct iovec
200200

201201
// likely() and unlikely(). Branch hints
202202
// This is an idiom from the linux kernel
203-
#ifdef __GNUC__
203+
#if defined(__GNUC__) || (defined(__has_builtin) && __has_builtin(__builtin_expect))
204204
#ifndef likely
205205
#define likely(x) __builtin_expect (!!(x), 1)
206206
#endif

0 commit comments

Comments
 (0)