_watcom.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. // STLport configuration file
  2. // It is internal STLport header - DO NOT include it directly
  3. #define _STLP_COMPILER "Watcom"
  4. #if (__WATCOMC__ < 1250)
  5. # error Not supported!
  6. #endif
  7. #ifndef _CPPRTTI
  8. # define _STLP_NO_RTTI 1
  9. #endif
  10. // for switches (-xs, -xss, -xst)
  11. #if !(defined (__SW_XS) || defined (__SW_XSS) || defined(__SW_XST))
  12. # define _STLP_HAS_NO_EXCEPTIONS 1
  13. #endif
  14. #if defined (_MT) && !defined (_NOTHREADS)
  15. # define _STLP_THREADS 1
  16. #endif
  17. #define _STLP_NO_VENDOR_STDLIB_L
  18. #define _STLP_NO_VENDOR_MATH_F
  19. #define _STLP_NO_VENDOR_MATH_L
  20. #define _STLP_LONG_LONG long long
  21. #define _STLP_CALL __cdecl
  22. #define _STLP_IMPORT_DECLSPEC __declspec(dllimport)
  23. #define _STLP_NO_CONST_IN_PAIR
  24. //#define _STLP_DONT_USE_PRIV_NAMESPACE
  25. //#define _STLP_NO_MOVE_SEMANTIC
  26. //#define _STLP_NO_TYPENAME_IN_TEMPLATE_HEADER
  27. #define _STLP_DONT_SUPPORT_REBIND_MEMBER_TEMPLATE
  28. #define _STLP_NO_RELOPS_NAMESPACE
  29. #define _STLP_NEEDS_EXTRA_TEMPLATE_CONSTRUCTORS
  30. #define _STLP_NO_STATIC_CONST_DEFINITION
  31. //#define _STLP_HAS_SPECIFIC_PROLOG_EPILOG
  32. #define _STLP_DONT_SIMULATE_PARTIAL_SPEC_FOR_TYPE_TRAITS
  33. //#define _STLP_USE_OLD_HP_ITERATOR_QUERIES
  34. #define _STLP_NO_FUNCTION_TMPL_PARTIAL_ORDER 1
  35. #define _STLP_NO_CLASS_PARTIAL_SPECIALIZATION 1
  36. //#define _STLP_NO_MEMBER_TEMPLATE_KEYWORD 1
  37. //#define _STLP_NO_MEMBER_TEMPLATES 1
  38. //#define _STLP_NO_MEMBER_TEMPLATE_CLASSES 1
  39. //#define _STLP_LIMITED_DEFAULT_TEMPLATES 1
  40. //#define _STLP_HAS_NO_NAMESPACES 1
  41. //#define _STLP_NEED_TYPENAME 1
  42. #define _STLP_NO_EXPLICIT_FUNCTION_TMPL_ARGS 1
  43. //#define _STLP_STATIC_CONST_INIT_BUG 1
  44. // #define _STLP_THROW_RETURN_BUG 1
  45. //#define _STLP_NO_TEMPLATE_CONVERSIONS 1
  46. #define _STLP_BASE_TYPEDEF_OUTSIDE_BUG 1
  47. #define _STLP_NO_DEFAULT_NON_TYPE_PARAM 1
  48. #define _STLP_NON_TYPE_TMPL_PARAM_BUG 1
  49. //#define _STLP_NONTEMPL_BASE_MATCH_BUG
  50. //#define _STLP_NO_EXCEPTION_HEADER 1
  51. #define _STLP_NO_BAD_ALLOC 1
  52. //#define _STLP_NO_TYPENAME_ON_RETURN_TYPE
  53. //#define _STLP_NESTED_TYPE_PARAM_BUG 1
  54. //#define _STLP_NO_USING_FOR_GLOBAL_FUNCTIONS 1
  55. #define _STLP_NO_ARROW_OPERATOR 1
  56. // This one is present in 11, but apparently has bugs (with auto_ptr).
  57. //#define _STLP_NO_NEW_STYLE_CASTS 1
  58. // Get rid of Watcom's min and max macros
  59. #undef min
  60. #undef max
  61. // On QNX, headers are supposed to be found in /usr/include,
  62. // so default "../include" should work.
  63. #ifndef __QNX__
  64. # define _STLP_NATIVE_INCLUDE_PATH ../h
  65. #else
  66. // boris : is this true or just the header is not in /usr/include ?
  67. # define _STLP_NO_TYPEINFO 1
  68. #endif
  69. // Inline replacements for locking calls under Watcom
  70. // Define _STLP_NO_WATCOM_INLINE_INTERLOCK to keep using
  71. // standard WIN32 calls
  72. // Define _STL_MULTIPROCESSOR to enable lock
  73. #define _STLP_NO_WATCOM_INLINE_INTERLOCK
  74. #if !defined(_STLP_NO_WATCOM_INLINE_INTERLOCK)
  75. long __stl_InterlockedIncrement( long *var );
  76. long __stl_InterlockedDecrement( long *var );
  77. #ifdef _STL_MULTIPROCESSOR
  78. // Multiple Processors, add lock prefix
  79. #pragma aux __stl_InterlockedIncrement parm [ ecx ] = \
  80. ".586" \
  81. "mov eax, 1" \
  82. "lock xadd [ecx], eax" \
  83. "inc eax" \
  84. value [eax];
  85. #pragma aux __stl_InterlockedDecrement parm [ ecx ] = \
  86. ".586" \
  87. "mov eax, 0FFFFFFFFh" \
  88. "lock xadd [ecx], eax" \
  89. "dec eax" \
  90. value [eax];
  91. #else
  92. // Single Processor, lock prefix not needed
  93. #pragma aux __stl_InterlockedIncrement parm [ ecx ] = \
  94. ".586" \
  95. "mov eax, 1" \
  96. "xadd [ecx], eax" \
  97. "inc eax" \
  98. value [eax];
  99. #pragma aux __stl_InterlockedDecrement parm [ ecx ] = \
  100. ".586" \
  101. "mov eax, 0FFFFFFFFh" \
  102. "xadd [ecx], eax" \
  103. "dec eax" \
  104. value [eax];
  105. #endif // _STL_MULTIPROCESSOR
  106. long __stl_InterlockedExchange( long *Destination, long Value );
  107. // xchg has auto-lock
  108. #pragma aux __stl_InterlockedExchange parm [ecx] [eax] = \
  109. ".586" \
  110. "xchg eax, [ecx]" \
  111. value [eax];
  112. # define _STLP_ATOMIC_INCREMENT(__x) __stl_InterlockedIncrement((long*)__x)
  113. # define _STLP_ATOMIC_DECREMENT(__x) __stl_InterlockedDecrement((long*)__x)
  114. # define _STLP_ATOMIC_EXCHANGE(__x, __y) __stl_InterlockedExchange((long*)__x, (long)__y)
  115. # define _STLP_ATOMIC_EXCHANGE_PTR(__x, __y) __stl_InterlockedExchange((long*)__x, (long)__y)
  116. #endif /* INLINE INTERLOCK */