ua_config.h.in 1.7 KB

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