make sure errno is always set on failure

This commit is contained in:
Daniel Micay 2018-08-28 22:46:20 -04:00
parent 66aa98dbd9
commit 8b42e8c3d6
2 changed files with 10 additions and 6 deletions

4
util.h
View file

@ -3,8 +3,8 @@
#include <stdnoreturn.h>
#define likely(x) __builtin_expect((x), 1)
#define unlikely(x) __builtin_expect((x), 0)
#define likely(x) __builtin_expect(!!(x), 1)
#define unlikely(x) __builtin_expect(!!(x), 0)
#define COLD __attribute__((cold))
#define UNUSED __attribute__((unused))