X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=include%2Fcompiler.h;h=4e047c7fd2cd08646a5e5b0bea47bb2dd46666c7;hb=7aabd2b12c5108276eb1fc7789b8955f3258db98;hp=272fd3cf628c758f9a4d5f019d2a093f2955c47a;hpb=23b5b1d3e1e33e9650cc7a4e09901272a3811c64;p=u-boot diff --git a/include/compiler.h b/include/compiler.h index 272fd3cf62..4e047c7fd2 100644 --- a/include/compiler.h +++ b/include/compiler.h @@ -25,8 +25,6 @@ #include #include -extern int errno; - #if !defined(__WIN32__) && !defined(__MINGW32__) # include #endif @@ -46,15 +44,15 @@ extern int errno; #ifdef __linux__ # include # include -#elif defined(__MACH__) +#elif defined(__MACH__) || defined(__FreeBSD__) # include typedef unsigned long ulong; -typedef unsigned int uint; #endif typedef uint8_t __u8; typedef uint16_t __u16; typedef uint32_t __u32; +typedef unsigned int uint; #define uswap_16(x) \ ((((x) & 0xff00) >> 8) | \ @@ -122,4 +120,10 @@ typedef unsigned int uintptr_t; #endif +/* compiler options */ +#define uninitialized_var(x) x = x + +#define likely(x) __builtin_expect(!!(x), 1) +#define unlikely(x) __builtin_expect(!!(x), 0) + #endif