projects
/
m6w6
/
libmemcached
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
|
github
raw
|
patch
|
inline
| side by side (parent:
9e71213
)
check endianess
author
Michael Wallner
<mike@php.net>
Tue, 13 Oct 2020 20:20:46 +0000
(22:20 +0200)
committer
Michael Wallner
<mike@php.net>
Tue, 13 Oct 2020 20:20:46 +0000
(22:20 +0200)
CMake/_Include.cmake
patch
|
blob
|
history
example/byteorder.cc
patch
|
blob
|
history
src/libhashkit/jenkins.cc
patch
|
blob
|
history
src/libmemcached/byteorder.cc
patch
|
blob
|
history
src/mem_config.h.in
patch
|
blob
|
history
diff --git
a/CMake/_Include.cmake
b/CMake/_Include.cmake
index 67fe16bfd826c88728cd109ea86a0523899f8311..7067ef46fc4cea2ab5a5b6ed57c0316aba713fd3 100644
(file)
--- a/
CMake/_Include.cmake
+++ b/
CMake/_Include.cmake
@@
-76,6
+76,9
@@
endif()
# system checks
# system checks
+include(TestBigEndian)
+test_big_endian(WORDS_BIGENDIAN)
+
check_header(alloca.h)
check_header(arpa/inet.h)
check_header(dlfcn.h)
check_header(alloca.h)
check_header(arpa/inet.h)
check_header(dlfcn.h)
diff --git
a/example/byteorder.cc
b/example/byteorder.cc
index fdfa0217d73c4024824bfdafe67c1d0068adc4c9..58ac5de7eb39f06d2fadb8f147603cd2588bbb43 100644
(file)
--- a/
example/byteorder.cc
+++ b/
example/byteorder.cc
@@
-1,5
+1,5
@@
/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
- *
+ *
* Libmemcached library
*
* Copyright (C) 2011 Data Differential, http://datadifferential.com/
* Libmemcached library
*
* Copyright (C) 2011 Data Differential, http://datadifferential.com/
@@
-45,7
+45,7
@@
#ifndef swap64
static inline uint64_t swap64(uint64_t in)
{
#ifndef swap64
static inline uint64_t swap64(uint64_t in)
{
-#if
ndef
WORDS_BIGENDIAN
+#if
!
WORDS_BIGENDIAN
/* Little endian, flip the bytes around until someone makes a faster/better
* way to do this. */
uint64_t rv= 0;
/* Little endian, flip the bytes around until someone makes a faster/better
* way to do this. */
uint64_t rv= 0;
diff --git
a/src/libhashkit/jenkins.cc
b/src/libhashkit/jenkins.cc
index d66c64133d71e165b3835184dc169d1e8df362b9..65aa1d11c6110269fc46e0bf7ea20e098a45200a 100644
(file)
--- a/
src/libhashkit/jenkins.cc
+++ b/
src/libhashkit/jenkins.cc
@@
-1,5
+1,5
@@
/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
- *
+ *
* HashKit library
*
* Copyright (C) 2011-2012 Data Differential, http://datadifferential.com/
* HashKit library
*
* Copyright (C) 2011-2012 Data Differential, http://datadifferential.com/
@@
-99,7
+99,7
@@
__attribute__((no_sanitize_address,no_sanitize("address")))
uint32_t hashkit_jenkins(const char *key, size_t length, void *)
{
uint32_t a,b,c; /* internal state */
uint32_t hashkit_jenkins(const char *key, size_t length, void *)
{
uint32_t a,b,c; /* internal state */
-#if
ndef
WORDS_BIGENDIAN
+#if
!
WORDS_BIGENDIAN
union { const void *ptr; size_t i; } u;
u.ptr = key;
#endif
union { const void *ptr; size_t i; } u;
u.ptr = key;
#endif
@@
-107,7
+107,7
@@
uint32_t hashkit_jenkins(const char *key, size_t length, void *)
/* Set up the internal state */
a = b = c = 0xdeadbeef + ((uint32_t)length) + JENKINS_INITVAL;
/* Set up the internal state */
a = b = c = 0xdeadbeef + ((uint32_t)length) + JENKINS_INITVAL;
-#if
ndef
WORDS_BIGENDIAN
+#if
!
WORDS_BIGENDIAN
if ((u.i & 0x3) == 0)
{
const uint32_t *k = (const uint32_t *)key; /* read 32-bit chunks */
if ((u.i & 0x3) == 0)
{
const uint32_t *k = (const uint32_t *)key; /* read 32-bit chunks */
@@
-262,7
+262,7
@@
uint32_t hashkit_jenkins(const char *key, size_t length, void *)
case 0 : return c;
default : return c;
}
case 0 : return c;
default : return c;
}
-#if
ndef
WORDS_BIGENDIAN
+#if
!
WORDS_BIGENDIAN
}
#endif
}
#endif
diff --git
a/src/libmemcached/byteorder.cc
b/src/libmemcached/byteorder.cc
index 44500add8832a8fd33ec318a874575e21a3ae623..a32232a94cc104a36ed6d58ce38c0456e4e225f5 100644
(file)
--- a/
src/libmemcached/byteorder.cc
+++ b/
src/libmemcached/byteorder.cc
@@
-1,5
+1,5
@@
/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
- *
+ *
* Libmemcached library
*
* Copyright (C) 2011 Data Differential, http://datadifferential.com/
* Libmemcached library
*
* Copyright (C) 2011 Data Differential, http://datadifferential.com/
@@
-42,7
+42,7
@@
#ifndef swap64
static inline uint64_t swap64(uint64_t in)
{
#ifndef swap64
static inline uint64_t swap64(uint64_t in)
{
-#if
ndef
WORDS_BIGENDIAN
+#if
!
WORDS_BIGENDIAN
/* Little endian, flip the bytes around until someone makes a faster/better
* way to do this. */
uint64_t rv= 0;
/* Little endian, flip the bytes around until someone makes a faster/better
* way to do this. */
uint64_t rv= 0;
diff --git
a/src/mem_config.h.in
b/src/mem_config.h.in
index 9609ab40ebc21412e30753bf45138badc07a6158..f761ade06494142f9197d81606f9f0f0150735c6 100644
(file)
--- a/
src/mem_config.h.in
+++ b/
src/mem_config.h.in
@@
-5,6
+5,8
@@
#define LIBMEMCACHED_WITH_SASL_PWDB "@LIBMEMCACHED_WITH_SASL_PWDB@"
#define LIBMEMCACHED_WITH_SASL_CONF "@LIBMEMCACHED_WITH_SASL_CONF@"
#define LIBMEMCACHED_WITH_SASL_PWDB "@LIBMEMCACHED_WITH_SASL_PWDB@"
#define LIBMEMCACHED_WITH_SASL_CONF "@LIBMEMCACHED_WITH_SASL_CONF@"
+#cmakedefine WORDS_BIGENDIAN 1
+
#cmakedefine HAVE_C_STDATOMIC 1
#cmakedefine HAVE_CXX_STDATOMIC 1
#cmakedefine HAVE_C_STDATOMIC 1
#cmakedefine HAVE_CXX_STDATOMIC 1
@@
-56,7
+58,6
@@
#cmakedefine HAVE_WINSOCK2_H 1
#cmakedefine HAVE_WS2TCPIP_H 1
#cmakedefine HAVE_WINSOCK2_H 1
#cmakedefine HAVE_WS2TCPIP_H 1
-
#cmakedefine HAVE_CINTTYPES 1
#cmakedefine HAVE_CSTDINT 1
#if defined(__cplusplus)
#cmakedefine HAVE_CINTTYPES 1
#cmakedefine HAVE_CSTDINT 1
#if defined(__cplusplus)