Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(991)

Unified Diff: base/sys_byteorder.h

Issue 16206002: Add more support for FreeBSD (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: base/sys_byteorder.h
diff --git a/base/sys_byteorder.h b/base/sys_byteorder.h
index 97e33acfdab33d5093cf5441284eb5f25a314c2b..17b662c58f0c148249252f76cce625118638be9f 100644
--- a/base/sys_byteorder.h
+++ b/base/sys_byteorder.h
@@ -25,7 +25,7 @@
#include <stdlib.h>
#elif defined(OS_MACOSX)
#include <libkern/OSByteOrder.h>
-#elif defined(OS_OPENBSD)
+#elif defined(OS_BSD)
#include <sys/endian.h>
#else
#include <byteswap.h>
@@ -42,6 +42,8 @@ inline uint16 ByteSwap(uint16 x) {
return OSSwapInt16(x);
#elif defined(OS_OPENBSD)
return swap16(x);
+#elif defined(OS_FREEBSD)
+ return bswap16(x);
#else
return bswap_16(x);
#endif
@@ -53,6 +55,8 @@ inline uint32 ByteSwap(uint32 x) {
return OSSwapInt32(x);
#elif defined(OS_OPENBSD)
return swap32(x);
+#elif defined(OS_FREEBSD)
+ return bswap32(x);
#else
return bswap_32(x);
#endif
@@ -64,6 +68,8 @@ inline uint64 ByteSwap(uint64 x) {
return OSSwapInt64(x);
#elif defined(OS_OPENBSD)
return swap64(x);
+#elif defined(OS_FREEBSD)
+ return bswap64(x);
#else
return bswap_64(x);
#endif

Powered by Google App Engine
This is Rietveld 408576698