Platform_POSIX.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. //
  2. // Platform_POSIX.h
  3. //
  4. // $Id: //poco/1.4/Foundation/include/Poco/Platform_POSIX.h#1 $
  5. //
  6. // Library: Foundation
  7. // Package: Core
  8. // Module: Platform
  9. //
  10. // Platform and architecture identification macros
  11. // and platform-specific definitions for various POSIX platforms
  12. //
  13. // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
  14. // and Contributors.
  15. //
  16. // SPDX-License-Identifier: BSL-1.0
  17. //
  18. #ifndef Foundation_Platform_POSIX_INCLUDED
  19. #define Foundation_Platform_POSIX_INCLUDED
  20. //
  21. // PA-RISC based HP-UX platforms have some issues...
  22. //
  23. #if defined(hpux) || defined(_hpux)
  24. #if defined(__hppa) || defined(__hppa__)
  25. #define POCO_NO_SYS_SELECT_H 1
  26. #if defined(__HP_aCC)
  27. #define POCO_NO_TEMPLATE_ICOMPARE 1
  28. #endif
  29. #endif
  30. #endif
  31. //
  32. // Thread-safety of local static initialization
  33. //
  34. #if __cplusplus >= 201103L || __GNUC__ >= 4 || defined(__clang__)
  35. #ifndef POCO_LOCAL_STATIC_INIT_IS_THREADSAFE
  36. #define POCO_LOCAL_STATIC_INIT_IS_THREADSAFE 1
  37. #endif
  38. #endif
  39. #ifdef __GNUC__
  40. #ifndef __THROW
  41. #ifndef __GNUC_PREREQ
  42. #define __GNUC_PREREQ(maj, min) (0)
  43. #endif
  44. #if defined __cplusplus && __GNUC_PREREQ (2,8)
  45. #define __THROW throw ()
  46. #else
  47. #define __THROW
  48. #endif
  49. #endif
  50. //
  51. // GCC diagnostics enable/disable by Patrick Horgan, see
  52. // http://dbp-consulting.com/tutorials/SuppressingGCCWarnings.html
  53. // use example: GCC_DIAG_OFF(unused-variable)
  54. //
  55. #if defined(POCO_COMPILER_GCC) && (((__GNUC__ * 100) + __GNUC_MINOR__) >= 406)
  56. #ifdef GCC_DIAG_OFF
  57. #undef GCC_DIAG_OFF
  58. #endif
  59. #ifdef GCC_DIAG_ON
  60. #undef GCC_DIAG_ON
  61. #endif
  62. #define GCC_DIAG_STR(s) #s
  63. #define GCC_DIAG_JOINSTR(x,y) GCC_DIAG_STR(x ## y)
  64. #define GCC_DIAG_DO_PRAGMA(x) _Pragma (#x)
  65. #define GCC_DIAG_PRAGMA(x) GCC_DIAG_DO_PRAGMA(GCC diagnostic x)
  66. #if ((__GNUC__ * 100) + __GNUC_MINOR__) >= 406
  67. #define GCC_DIAG_OFF(x) GCC_DIAG_PRAGMA(push) \
  68. GCC_DIAG_PRAGMA(ignored GCC_DIAG_JOINSTR(-W,x))
  69. #define GCC_DIAG_ON(x) GCC_DIAG_PRAGMA(pop)
  70. #else
  71. #define GCC_DIAG_OFF(x) GCC_DIAG_PRAGMA(ignored GCC_DIAG_JOINSTR(-W,x))
  72. #define GCC_DIAG_ON(x) GCC_DIAG_PRAGMA(warning GCC_DIAG_JOINSTR(-W,x))
  73. #endif
  74. #else
  75. #define GCC_DIAG_OFF(x)
  76. #define GCC_DIAG_ON(x)
  77. #endif
  78. #endif // __GNUC__
  79. //
  80. // No syslog.h on QNX/BB10
  81. //
  82. #if defined(__QNXNTO__)
  83. #define POCO_NO_SYSLOGCHANNEL
  84. #endif
  85. #endif // Foundation_Platform_POSIX_INCLUDED