Просмотр исходного кода

working around a double-inclusion bug in amlgamation
@jpfr ua_config.h is somehow included twice in the amalgate, I could not fix it (amalgate is a mess)
@pfpmeijers this should bring you a big performance boost on x86

Stasik0 лет назад: 9
Родитель
Сommit
4fb5e8a1a0
2 измененных файлов с 2 добавлено и 6 удалено
  1. 1 5
      include/ua_config.h.in
  2. 1 1
      src/ua_types_encoding_binary.c

+ 1 - 5
include/ua_config.h.in

@@ -37,10 +37,6 @@
 //	#define le16toh(x)	{...}(x)
 //	#define le32toh(x)	{...}(x)
 //	#define le64toh(x)	{...}(x)
-
-#if defined(htole16) || defined(htole32) || defined(htole64) || \
-    defined(le16toh) || defined(le32toh) || defined(le64toh)
-#define UA_NON_LITTLEENDIAN_ARCHITECTURE
-#endif
+//  #define UA_NON_LITTLEENDIAN_ARCHITECTURE
 
 #endif /* UA_CONFIG_H_ */

+ 1 - 1
src/ua_types_encoding_binary.c

@@ -202,7 +202,7 @@ UA_StatusCode UA_UInt32_decodeBinary(UA_ByteString const *src, size_t *UA_RESTRI
     if((UA_Int32)(*offset + sizeof(UA_UInt32)) > src->length)
         return UA_STATUSCODE_BADDECODINGERROR;
     UA_UInt32 value = *((UA_UInt32*)&src->data[*offset]);
-#ifndef _WIN32
+#ifndef UA_NON_LITTLEENDIAN_ARCHITECTURE
     value = le32toh(value);
 #endif
     *dst = value;