ua_config.h.in 1.4 KB

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