X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=include%2Fcompiler.h;h=54999a7e82d056c656d24259d9aa7e6ba167180e;hb=6bc31fbe08f9036f5854a9e2399a43f3a96d1e2e;hp=23f4b834d8df0fdf3d821c2d52deb9aff56a3cce;hpb=96b35730a43160afa025ac405961737dbb0682b4;p=u-boot diff --git a/include/compiler.h b/include/compiler.h index 23f4b834d8..54999a7e82 100644 --- a/include/compiler.h +++ b/include/compiler.h @@ -44,10 +44,9 @@ #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; @@ -112,11 +111,25 @@ typedef unsigned int uint; #include #include +#if __SIZEOF_LONG__ == 8 +# define __WORDSIZE 64 +#elif __SIZEOF_LONG__ == 4 +# define __WORDSIZE 32 +#else +/* + * Assume 32-bit for now - only newer toolchains support this feature and + * this is only required for sandbox support at present. + */ +#define __WORDSIZE 32 +#endif + /* Types for `void *' pointers. */ #if __WORDSIZE == 64 typedef unsigned long int uintptr_t; -#else +#elif __WORDSIZE == 32 typedef unsigned int uintptr_t; +#else +#error "__WORDSIZE has unexpected value" #endif #endif