]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - include/compiler.h
Convert CONFIG_BOOTCOUNT_ENV to Kconfig
[people/ms/u-boot.git] / include / compiler.h
index 14519163a32bfa13d2df16a22d66735b28b52138..957f4b5d49a872f4642f0c2d34587a1a0abe1252 100644 (file)
@@ -15,7 +15,7 @@
     defined(__sun__)    || \
     defined(__APPLE__)
 # include <inttypes.h>
-#elif defined(__linux__) || defined(__WIN32__) || defined(__MINGW32__)
+#elif defined(__linux__) || defined(__WIN32__) || defined(__MINGW32__) || defined(__OpenBSD__)
 # include <stdint.h>
 #endif
 
 # include <machine/endian.h>
 typedef unsigned long ulong;
 #endif
+#ifdef __FreeBSD__
+# include <sys/endian.h> /* htole32 and friends */
+# define __BYTE_ORDER BYTE_ORDER
+# define __LITTLE_ENDIAN LITTLE_ENDIAN
+# define __BIG_ENDIAN BIG_ENDIAN
+#elif defined(__OpenBSD__)
+# include <endian.h>
+# define __BYTE_ORDER BYTE_ORDER
+# define __LITTLE_ENDIAN LITTLE_ENDIAN
+# define __BIG_ENDIAN BIG_ENDIAN
+#endif
+
 #include <time.h>
 
 typedef uint8_t __u8;
@@ -108,6 +120,14 @@ typedef unsigned int uint;
 
 #else /* !USE_HOSTCC */
 
+#ifdef CONFIG_USE_STDINT
+/* Provided by gcc. */
+#include <stdint.h>
+#else
+/* Type for `void *' pointers. */
+typedef unsigned long int uintptr_t;
+#endif
+
 #include <linux/string.h>
 #include <linux/types.h>
 #include <asm/byteorder.h>
@@ -124,9 +144,6 @@ typedef unsigned int uint;
 #define __WORDSIZE     32
 #endif
 
-/* Type for `void *' pointers. */
-typedef unsigned long int uintptr_t;
-
 #endif /* USE_HOSTCC */
 
 #define likely(x)      __builtin_expect(!!(x), 1)