ua_config.h.in 1.4 KB

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