ua_config.h.in 1.5 KB

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