libsysprof-capture: Replace G_{UN,}LIKELY with SYSPROF_{UN,}LIKELY

This does the same thing for modern compilers, but without the GLib
dependency.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Helps: #40
This commit is contained in:
Philip Withnall
2020-07-01 16:52:19 +01:00
parent c9f54fcc68
commit f925fab564
7 changed files with 32 additions and 23 deletions

View File

@ -72,3 +72,11 @@
#else
#define SYSPROF_INTERNAL
#endif
#if defined(__GNUC__)
#define SYSPROF_LIKELY(expr) (__builtin_expect (!!(expr), 1))
#define SYSPROF_UNLIKELY(expr) (__builtin_expect (!!(expr), 0))
#else
#define SYSPROF_LIKELY(expr) (expr)
#define SYSPROF_UNLIKELY(expr) (expr)
#endif