You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ma...@apache.org on 2017/02/02 22:03:59 UTC

incubator-mynewt-core git commit: kernel/os; rename macro __bswap_XX -> os_bswap_XX. __bswap_32() is an inline function in Linux system headers, and causes trouble with simulator builds.

Repository: incubator-mynewt-core
Updated Branches:
  refs/heads/develop e9ff7acba -> ea1c54702


kernel/os; rename macro __bswap_XX -> os_bswap_XX.
__bswap_32() is an inline function in Linux system headers,
and causes trouble with simulator builds.


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/commit/ea1c5470
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/ea1c5470
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/ea1c5470

Branch: refs/heads/develop
Commit: ea1c54702a828668af0ea0b693a65f58bc64298e
Parents: e9ff7ac
Author: Marko Kiiskila <ma...@runtime.io>
Authored: Thu Feb 2 14:00:20 2017 -0800
Committer: Marko Kiiskila <ma...@runtime.io>
Committed: Thu Feb 2 14:00:20 2017 -0800

----------------------------------------------------------------------
 kernel/os/include/os/endian.h | 42 +++++++++++++++++++-------------------
 1 file changed, 21 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/ea1c5470/kernel/os/include/os/endian.h
----------------------------------------------------------------------
diff --git a/kernel/os/include/os/endian.h b/kernel/os/include/os/endian.h
index b8b39b5..ca8698d 100644
--- a/kernel/os/include/os/endian.h
+++ b/kernel/os/include/os/endian.h
@@ -27,8 +27,8 @@ extern "C" {
 #endif
 
 /* Internal helpers */
-#ifndef __bswap_64
-#define __bswap_64(x)   ((uint64_t)                 \
+#ifndef os_bswap_64
+#define os_bswap_64(x)   ((uint64_t)                \
      ((((x) & 0xff00000000000000ull) >> 56) |       \
       (((x) & 0x00ff000000000000ull) >> 40) |       \
       (((x) & 0x0000ff0000000000ull) >> 24) |       \
@@ -39,16 +39,16 @@ extern "C" {
       (((x) & 0x00000000000000ffull) << 56)))
 #endif
 
-#ifndef __bswap_32
-#define __bswap_32(x)    ((uint32_t)                \
+#ifndef os_bswap_32
+#define os_bswap_32(x)    ((uint32_t)               \
     ((((x) & 0xff000000) >> 24) |                   \
      (((x) & 0x00ff0000) >>  8) |                   \
      (((x) & 0x0000ff00) <<  8) |                   \
      (((x) & 0x000000ff) << 24)))
 #endif
 
-#ifndef __bswap_16
-#define __bswap_16(x)   ((uint16_t)                 \
+#ifndef os_bswap_16
+#define os_bswap_16(x)   ((uint16_t)                \
     ((((x) & 0xff00) >> 8) |                        \
      (((x) & 0x00ff) << 8)))
 #endif
@@ -84,7 +84,7 @@ extern "C" {
 #endif
 
 #ifndef htole16
-#define htole16(x) __bswap_16 (x)
+#define htole16(x) os_bswap_16 (x)
 #endif
 
 #ifndef be16toh
@@ -92,7 +92,7 @@ extern "C" {
 #endif
 
 #ifndef le16toh
-#define le16toh(x) __bswap_16 (x)
+#define le16toh(x) os_bswap_16 (x)
 #endif
 
 #ifndef htobe32
@@ -100,7 +100,7 @@ extern "C" {
 #endif
 
 #ifndef htole32
-#define htole32(x) __bswap_32 (x)
+#define htole32(x) os_bswap_32 (x)
 #endif
 
 #ifndef be32toh
@@ -108,7 +108,7 @@ extern "C" {
 #endif
 
 #ifndef le32toh
-#define le32toh(x) __bswap_32 (x)
+#define le32toh(x) os_bswap_32 (x)
 #endif
 
 #ifndef htobe64
@@ -116,7 +116,7 @@ extern "C" {
 #endif
 
 #ifndef htole64
-#define htole64(x) __bswap_64 (x)
+#define htole64(x) os_bswap_64 (x)
 #endif
 
 #ifndef be64toh
@@ -124,13 +124,13 @@ extern "C" {
 #endif
 
 #ifndef le64toh
-#define le64toh(x) __bswap_64 (x)
+#define le64toh(x) os_bswap_64 (x)
 #endif
 
 #else
 
 #ifndef ntohll
-#define ntohll(x)   __bswap_64(x)
+#define ntohll(x)   os_bswap_64(x)
 #endif
 
 #ifndef htonll
@@ -138,7 +138,7 @@ extern "C" {
 #endif
 
 #ifndef ntohl
-#define ntohl(x)    __bswap_32(x)
+#define ntohl(x)    os_bswap_32(x)
 #endif
 
 #ifndef htonl
@@ -146,7 +146,7 @@ extern "C" {
 #endif
 
 #ifndef htons
-#define htons(x)    __bswap_16(x)
+#define htons(x)    os_bswap_16(x)
 #endif
 
 #ifndef ntohs
@@ -154,7 +154,7 @@ extern "C" {
 #endif
 
 #ifndef htobe16
-#define htobe16(x) __bswap_16(x)
+#define htobe16(x) os_bswap_16(x)
 #endif
 
 #ifndef htole16
@@ -162,7 +162,7 @@ extern "C" {
 #endif
 
 #ifndef be16toh
-#define be16toh(x) __bswap_16(x)
+#define be16toh(x) os_bswap_16(x)
 #endif
 
 #ifndef le16toh
@@ -170,7 +170,7 @@ extern "C" {
 #endif
 
 #ifndef htobe32
-#define htobe32(x) __bswap_32(x)
+#define htobe32(x) os_bswap_32(x)
 #endif
 
 #ifndef htole32
@@ -178,7 +178,7 @@ extern "C" {
 #endif
 
 #ifndef be32toh
-#define be32toh(x) __bswap_32(x)
+#define be32toh(x) os_bswap_32(x)
 #endif
 
 #ifndef le32toh
@@ -186,7 +186,7 @@ extern "C" {
 #endif
 
 #ifndef htobe64
-#define htobe64(x) __builtin_bswap64(x)
+#define htobe64(x) os_bswap64(x)
 #endif
 
 #ifndef htole64
@@ -194,7 +194,7 @@ extern "C" {
 #endif
 
 #ifndef be64toh
-#define be64toh(x) __builtin_bswap64(x)
+#define be64toh(x) os_bswap64(x)
 #endif
 
 #ifndef le64toh