ua_config.h.in 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #ifndef UA_CONFIG_H_
  2. #define UA_CONFIG_H_
  3. #define UA_LOGLEVEL ${UA_LOGLEVEL}
  4. #cmakedefine UA_MULTITHREADING
  5. /* Function Export */
  6. #ifdef _WIN32
  7. # ifdef UA_DYNAMIC_LINKING
  8. # ifdef __GNUC__
  9. # define UA_EXPORT __attribute__ ((dllexport))
  10. # else
  11. # define UA_EXPORT __declspec(dllexport)
  12. # endif
  13. # else
  14. # ifdef __GNUC__
  15. # define UA_EXPORT __attribute__ ((dllexport))
  16. # else
  17. # define UA_EXPORT __declspec(dllimport)
  18. # endif
  19. # endif
  20. #else
  21. # if __GNUC__ || __clang__
  22. # define UA_EXPORT __attribute__ ((visibility ("default")))
  23. # else
  24. # define UA_EXPORT
  25. # endif
  26. #endif
  27. /* Endianness */
  28. #if defined(__linux__) || defined(__APPLE__)
  29. # include <endian.h>
  30. # if ( __BYTE_ORDER != __LITTLE_ENDIAN )
  31. # define UA_NON_LITTLEENDIAN_ARCHITECTURE
  32. # endif
  33. #endif
  34. /* Force non-little endian manually by setting the following. */
  35. // #define UA_NON_LITTLEENDIAN_ARCHITECTURE
  36. // #define htole16(x) {...}(x)
  37. // #define htole32(x) {...}(x)
  38. // #define htole64(x) {...}(x)
  39. // #define le16toh(x) {...}(x)
  40. // #define le32toh(x) {...}(x)
  41. // #define le64toh(x) {...}(x)
  42. /* Mixed Endian */
  43. #ifdef __ARM_ARCH_4T__
  44. # define UA_MIXED_ENDIAN
  45. #endif
  46. /* Aligned Memory Access */
  47. #if defined(__arm__) && !defined(__ARM_FEATURE_UNALIGNED)
  48. # define UA_ALIGNED_MEMORY_ACCESS
  49. #endif
  50. #endif /* UA_CONFIG_H_ */