/project/jni/stlport/stlport/stl/config/_evc.h

https://github.com/aichunyu/FFPlayer · C Header · 354 lines · 205 code · 53 blank · 96 comment · 19 complexity · fbdbcfc648deab954f86810917920e08 MD5 · raw file

  1. /*
  2. * File to have Microsoft eMbedded Visual C++ 3.0 and .NET working with STLport
  3. * May 2004
  4. * Origin : Zdenek Nemec - zero@mapfactor.com
  5. * Michael Fink - vividos@users.sourceforge.net
  6. */
  7. #ifndef _STLP_EVC_H
  8. #define _STLP_EVC_H
  9. #define _STLP_COMPILER "eMbedded Visual C++"
  10. // This flag is being used by STLport to support
  11. // old-fashioned Windows CE SDK (see stl_wince.h)
  12. // do not use with eMebedded Visual C++ 3 or 4!
  13. #ifdef _STLP_WINCE
  14. # undef _STLP_WINCE
  15. #endif
  16. /* Compiler dependent define. The following defines may be available:
  17. * _STLP_WCE_EVC3 when compiling under eMbedded Visual C++ 3
  18. * _STLP_WCE_NET when compiling under eMbedded Visual C++ .NET
  19. * _STLP_WCE always defined when compiling with one of the above
  20. */
  21. #undef _STLP_WCE_EVC3
  22. #undef _STLP_WCE_NET
  23. #if (_WIN32_WCE > 300)
  24. # define _STLP_WCE_NET UNDER_CE
  25. #elif (_WIN32_WCE == 300)
  26. # define _STLP_WCE_EVC3 UNDER_CE
  27. #else
  28. # error No support for Windows CE below 3.0!
  29. #endif
  30. // This is defined for all platforms using Windows CE
  31. #define _STLP_WCE
  32. /* All Windows CE versions up to at least version 5 are little-endian, even
  33. * if the hardware (like e.g. MIPS) can be configured for big-endian, too. */
  34. #define _STLP_LITTLE_ENDIAN
  35. // Ensure _DEBUG is defined.
  36. #if defined (DEBUG) && !defined (_DEBUG)
  37. # define _DEBUG
  38. #endif
  39. // in evc3/4, on ARM, check that _STLP_DEBUG is not defined
  40. // the ARM compiler has a bug that prevents that debug mode from working
  41. #if _WIN32_WCE < 500 && defined(ARM) && defined(_STLP_DEBUG)
  42. # error _STLP_DEBUG mode is not supported in evc3 and evc4 on the ARM platform!
  43. #endif
  44. // inherit all msvc6 options
  45. #include <stl/config/_msvc.h>
  46. // CE up to at least version 5 has no C locale support
  47. #define _STLP_NO_LOCALE_SUPPORT
  48. #if _WIN32_WCE >= 0x500
  49. // SDKs built with PB5 have terminate&co in namespace std...
  50. # define _STLP_VENDOR_TERMINATE_STD _STLP_VENDOR_STD
  51. # define _STLP_VENDOR_UNCAUGHT_EXCEPTION_STD _STLP_VENDOR_STD
  52. // ...and new_handler/set_new_handler in the global namespace.
  53. # define _STLP_GLOBAL_NEW_HANDLER 1
  54. #endif
  55. // Always threaded in eMbedded Visual C++ 3.0 and .NET
  56. #ifndef _MT
  57. # define _MT
  58. #endif
  59. // we don't have a static native runtime library
  60. #undef _STLP_USING_CROSS_NATIVE_RUNTIME_LIB
  61. #if _WIN32_WCE < 400
  62. // no long double under CE3 and older
  63. # define _STLP_NO_LONG_DOUBLE
  64. #endif
  65. // no *f and *l math functions available
  66. #define _STLP_NO_VENDOR_MATH_F
  67. #define _STLP_NO_VENDOR_MATH_L
  68. /*
  69. * Redirect cout, cerr and clog:
  70. * If defined redirect cout, cerr and clog to
  71. * files stdout.txt, stderr.txt and stdlog.txt
  72. */
  73. //# define _STLP_REDIRECT_STDSTREAMS
  74. /*
  75. * Static class members may generate LNK1179:
  76. * Wrong COMDAT packing may cause LNK1179 error.
  77. * For details see http://groups.google.com/groups?th=8a05c82c4ffee280
  78. * example P78. This define is not used/needed at this moment
  79. * but may came handy in future...
  80. */
  81. //# define _STLP_STATIC_MEMBERS_BUG
  82. // Use wide-string interface of windows native functions (CreateFile...).
  83. // Note that this should be defined all the time while under CE.
  84. #if defined (UNICODE)
  85. # define _STLP_USE_WIDE_INTERFACE
  86. #endif
  87. // Force exception std to std instead of __std_alias.
  88. #if defined (__cplusplus) && !defined (_STLP_HAS_NO_NAMESPACES)
  89. # ifdef _STLP_VENDOR_EXCEPT_STD
  90. # undef _STLP_VENDOR_EXCEPT_STD
  91. # endif
  92. # define _STLP_VENDOR_EXCEPT_STD std
  93. #endif
  94. // short string optimization bug under evc3, evc4 using ARM compiler
  95. #if _MSC_VER<1400 && (defined (ARM) || defined (_ARM_))
  96. # define _STLP_DONT_USE_SHORT_STRING_OPTIM
  97. #endif
  98. // when using MFC, disable another placement new declaration, since there is one in wcealt.h
  99. #if !defined (__BUILDING_STLPORT) && defined (_MFC_VER)
  100. # define __PLACEMENT_NEW_INLINE
  101. #endif
  102. // threads
  103. #undef _REENTRANT
  104. #define _REENTRANT
  105. #undef _NOTHREADS
  106. // Use old fashioned headers (ctime vs. time.h).
  107. #undef _STLP_NO_NEW_C_HEADERS
  108. #define _STLP_NO_NEW_C_HEADERS
  109. // exception handling support: only on evc4 and user added /GX to project settings
  110. #if defined (_STLP_WCE_EVC3) || !defined (_CPPUNWIND)
  111. # define _STLP_NO_EXCEPTION_HEADER
  112. # define _STLP_NO_EXCEPTIONS
  113. # undef _STLP_USE_EXCEPTIONS
  114. # ifndef __THROW_BAD_ALLOC
  115. # define __THROW_BAD_ALLOC { _STLP_WINCE_TRACE(L"out of memory"); ExitThread(1); }
  116. # endif
  117. #endif
  118. #define _STLP_WINCE_TRACE(msg) OutputDebugString(msg)
  119. /*
  120. * eMbedded Visual C++ .NET specific settings
  121. */
  122. #if defined (_STLP_WCE_NET)
  123. // evc4 has no locale and time support
  124. # define _STLP_NO_LOCALE_SUPPORT
  125. # define _STLP_NO_TIME_SUPPORT
  126. // ptrdiff_t is not defined in evc4 headers
  127. # ifndef _PTRDIFF_T_DEFINED
  128. typedef int ptrdiff_t;
  129. # define _PTRDIFF_T_DEFINED
  130. # endif
  131. /*
  132. * Helper macros for including the native headers in cases where a file with
  133. * the same name also exists in the STLport include folder. The idea behind
  134. * this is that we first go up one directory and then down into a dir that
  135. * is only present in the native install but not in STLport.
  136. *
  137. */
  138. # if !defined (_STLP_NATIVE_INCLUDE_PATH)
  139. # if defined (_X86_)
  140. # if defined (_STLP_WCE_TARGET_PROC_SUBTYPE_EMULATOR)
  141. # define _STLP_NATIVE_INCLUDE_PATH ../Emulator
  142. # else
  143. # define _STLP_NATIVE_INCLUDE_PATH ../X86
  144. # endif
  145. # elif defined (_ARM_)
  146. # if _MSC_VER < 1400
  147. // eVC3/4
  148. # if defined (ARMV4)
  149. # define _STLP_NATIVE_INCLUDE_PATH ../Armv4
  150. # elif defined (ARMV4I)
  151. # define _STLP_NATIVE_INCLUDE_PATH ../Armv4i
  152. # elif defined (ARMV4T)
  153. # define _STLP_NATIVE_INCLUDE_PATH ../Armv4t
  154. # else
  155. # error Unknown ARM SDK.
  156. # endif
  157. # else
  158. // VC8 crosscompiling for CE
  159. # if defined (ARMV4)
  160. # define _STLP_NATIVE_INCLUDE_PATH ../Armv4
  161. # elif defined(ARMV4I) || defined(ARMV4T)
  162. # define _STLP_NATIVE_INCLUDE_PATH ../Armv4i
  163. # else
  164. # error Unknown ARM SDK.
  165. # endif
  166. # endif
  167. # elif defined (_MIPS_)
  168. # if defined (MIPS16)
  169. # define _STLP_NATIVE_INCLUDE_PATH ../mips16
  170. # elif defined (MIPSII)
  171. # define _STLP_NATIVE_INCLUDE_PATH ../mipsII
  172. # elif defined (MIPSII_FP)
  173. # define _STLP_NATIVE_INCLUDE_PATH ../mipsII_fp
  174. # elif defined (MIPSIV)
  175. # define _STLP_NATIVE_INCLUDE_PATH ../mipsIV
  176. # elif defined (MIPSIV_FP)
  177. # define _STLP_NATIVE_INCLUDE_PATH ../mipsIV_fp
  178. # else
  179. # error Unknown MIPS SDK.
  180. # endif
  181. # elif defined (SHx)
  182. # if defined (SH3)
  183. # define _STLP_NATIVE_INCLUDE_PATH ../sh3
  184. # elif defined (SH4)
  185. # define _STLP_NATIVE_INCLUDE_PATH ../sh4
  186. # else
  187. # error Unknown SHx SDK.
  188. # endif
  189. # else
  190. # error Unknown SDK.
  191. # endif
  192. # endif /* !_STLP_NATIVE_INCLUDE_PATH */
  193. /* Workaround when using MFCCE and using <new> together: MFCCE's wcealt.h doesn't
  194. * check for __PLACEMENT_NEW_INLINE before defining operator new, so when <new>
  195. * defines the operatore before, there will be an error C2084:
  196. * "function 'void *__cdecl operator new(unsigned int,void *)' already has a body".
  197. */
  198. # ifdef _STLP_USE_MFC
  199. # define __PLACEMENT_NEW_INLINE
  200. # endif
  201. #endif /* _STLP_WCE_NET */
  202. /* Workaround in _windows.h needs native headers access macros
  203. * to be defined */
  204. #include <stl/config/_native_headers.h>
  205. /*
  206. * eMbedded Visual C++ 3.0 specific settings
  207. */
  208. #if defined (_STLP_WCE_EVC3)
  209. # define _STLP_NO_NATIVE_MBSTATE_T
  210. // evc3 has no locale and time support
  211. # define _STLP_NO_LOCALE_SUPPORT
  212. # define _STLP_NO_TIME_SUPPORT
  213. // evc3 has new, but no explicit header
  214. # define _STLP_NO_NEW_HEADER
  215. # define _STLP_NO_NEW_NEW_HEADER
  216. // evc3 has no bad_alloc and no typeinfo
  217. # undef _STLP_NO_BAD_ALLOC
  218. # define _STLP_NO_BAD_ALLOC
  219. # undef _STLP_NO_TYPEINFO
  220. # define _STLP_NO_TYPEINFO
  221. // missing things in eMbedded Visual C++ 3.0 headers
  222. # ifndef _SIZE_T_DEFINED
  223. typedef unsigned int size_t;
  224. # define _SIZE_T_DEFINED
  225. # endif
  226. # ifndef _WCHAR_T_DEFINED
  227. typedef unsigned short wchar_t;
  228. # define _WCHAR_T_DEFINED
  229. # endif
  230. // ptrdiff_t is not defined in evc3 headers
  231. # ifndef _PTRDIFF_T_DEFINED
  232. typedef int ptrdiff_t;
  233. # define _PTRDIFF_T_DEFINED
  234. # endif
  235. // clock_t is not defined in evc3 headers
  236. # ifndef _CLOCK_T_DEFINED
  237. typedef long clock_t;
  238. # define _CLOCK_T_DEFINED
  239. # endif
  240. // Struct tm is not defined in evc3 headers
  241. # ifndef _TM_DEFINED
  242. struct tm {
  243. int tm_sec; /* seconds after the minute - [0,59] */
  244. int tm_min; /* minutes after the hour - [0,59] */
  245. int tm_hour; /* hours since midnight - [0,23] */
  246. int tm_mday; /* day of the month - [1,31] */
  247. int tm_mon; /* months since January - [0,11] */
  248. int tm_year; /* years since 1900 */
  249. int tm_wday; /* days since Sunday - [0,6] */
  250. int tm_yday; /* days since January 1 - [0,365] */
  251. int tm_isdst; /* daylight savings time flag */
  252. };
  253. # define _TM_DEFINED
  254. # endif
  255. // define placement new and delete operator
  256. // note: when MFCCE headers are included first, don't define the new operator,
  257. // since it was already defined in wcealt.h
  258. # ifdef __cplusplus
  259. # ifndef __PLACEMENT_NEW_INLINE
  260. # ifndef _MFC_VER
  261. inline void *__cdecl operator new(size_t, void *_P) { return (_P); }
  262. # endif /* _MFC_VER */
  263. inline void __cdecl operator delete(void *, void *) { return; }
  264. # define __PLACEMENT_NEW_INLINE
  265. # endif
  266. # endif /* __cplusplus */
  267. // evc3 doesn't have native wide functions, e.g. fgetwc, wmemmove
  268. # define _STLP_NO_NATIVE_WIDE_FUNCTIONS
  269. // evc3 doesn't have assert.h
  270. # ifndef _ASSERT_DEFINED
  271. # define assert(expr) _STLP_ASSERT(expr)
  272. # define _ASSERT_DEFINED
  273. # endif
  274. #endif /* _STLP_WCE_EVC3 */
  275. // Minimize windows.h includes
  276. #if !defined (WIN32_LEAN_AND_MEAN)
  277. # define WIN32_LEAN_AND_MEAN
  278. #endif
  279. #if !defined (VC_EXTRALEAN)
  280. # define VC_EXTRALEAN
  281. #endif
  282. #if !defined (STRICT)
  283. # define STRICT
  284. #endif
  285. // Don't let windows.h define its min and max macros.
  286. #if !defined (NOMINMAX)
  287. # define NOMINMAX
  288. #endif
  289. /*
  290. * original call: TerminateProcess(GetCurrentProcess(), 0);
  291. * we substitute the GetCurrentProcess() with the result of the inline function
  292. * defined in kfuncs.h, since we then can avoid including <windows.h> at all.
  293. * all needed Win32 API functions are defined in <stl/_windows.h>
  294. */
  295. #ifndef _ABORT_DEFINED
  296. # define _STLP_ABORT() TerminateProcess(reinterpret_cast<HANDLE>(66), 0)
  297. # define _ABORT_DEFINED
  298. #endif
  299. // Notice: windows.h isn't included here anymore; all needed defines are in
  300. // stl/_windows.h now
  301. #endif /* _STLP_EVC_H */