ua_config.h.in 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. # include <endian.h>
  33. # if ( __BYTE_ORDER != __LITTLE_ENDIAN )
  34. # define UA_NON_LITTLEENDIAN_ARCHITECTURE
  35. # endif
  36. #endif
  37. /* Force non-little endian manually by setting the following. */
  38. // #define UA_NON_LITTLEENDIAN_ARCHITECTURE
  39. // #define htole16(x) {...}(x)
  40. // #define htole32(x) {...}(x)
  41. // #define htole64(x) {...}(x)
  42. // #define le16toh(x) {...}(x)
  43. // #define le32toh(x) {...}(x)
  44. // #define le64toh(x) {...}(x)
  45. /* Mixed Endian */
  46. #ifdef __ARM_ARCH_4T__
  47. # define UA_MIXED_ENDIAN
  48. # define UA_NON_LITTLEENDIAN_ARCHITECTURE
  49. #endif
  50. /* Aligned Memory Access */
  51. #if defined(__arm__) && !defined(__ARM_FEATURE_UNALIGNED)
  52. # define UA_ALIGNED_MEMORY_ACCESS
  53. #endif
  54. #endif /* UA_CONFIG_H_ */