user_config.h 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326
  1. /*
  2. * Copyright (c) 1999
  3. * Boris Fomitchev
  4. *
  5. * This material is provided "as is", with absolutely no warranty expressed
  6. * or implied. Any use is at your own risk.
  7. *
  8. * Permission to use or copy this software for any purpose is hereby granted
  9. * without fee, provided the above notices are retained on all copies.
  10. * Permission to modify the code and to distribute modified code is granted,
  11. * provided the above notices are retained, and a notice that the code was
  12. * modified is included with the above copyright notice.
  13. */
  14. /*
  15. * Purpose of this file :
  16. *
  17. * To hold user-definable portion of STLport settings which may be overridden
  18. * on per-project basis.
  19. * Please note that if you use STLport iostreams (compiled library) then you have
  20. * to use consistent settings when you compile STLport library and your project.
  21. * Those settings are defined in host.h and have to be the same for a given
  22. * STLport installation.
  23. */
  24. /*==========================================================
  25. * User-settable macros that control compilation:
  26. * Features selection
  27. *==========================================================*/
  28. /*
  29. * Use this switch for embedded systems where no iostreams are available
  30. * at all. STLport own iostreams will also get disabled automatically then.
  31. * You can either use STLport iostreams, or no iostreams.
  32. * If you want iostreams, you have to compile library in ../build/lib
  33. * and supply resulting library at link time.
  34. */
  35. /*
  36. #define _STLP_NO_IOSTREAMS 1
  37. */
  38. /*
  39. * Set _STLP_DEBUG to turn the "Debug Mode" on.
  40. * That gets you checked iterators/ranges in the manner
  41. * of "Safe STL". Very useful for debugging. Thread-safe.
  42. * Please do not forget to link proper STLport library flavor
  43. * (e.g libstlportstlg.so or libstlportstlg.a) when you set this flag
  44. * in STLport iostreams mode, namespace customization guaranty that you
  45. * link to the right library.
  46. */
  47. /*
  48. #define _STLP_DEBUG 1
  49. */
  50. /*
  51. * You can also choose the debug level:
  52. * STLport debug level: Default value
  53. * Check only what the STLport implementation consider as invalid.
  54. * It also change the iterator invalidation schema.
  55. * Standard debug level: Check for all operations the standard consider as "undefined behavior"
  56. * even if STlport implement it correctly. It also invalidates iterators
  57. * more often.
  58. */
  59. /*
  60. #define _STLP_DEBUG_LEVEL _STLP_STLPORT_DBG_LEVEL
  61. #define _STLP_DEBUG_LEVEL _STLP_STANDARD_DBG_LEVEL
  62. */
  63. /* When an inconsistency is detected by the 'safe STL' the program will abort.
  64. * If you prefer an exception define the following macro. The thrown exception
  65. * will be the Standard runtime_error exception.
  66. */
  67. /*
  68. #define _STLP_DEBUG_MODE_THROWS
  69. */
  70. /*
  71. * _STLP_NO_CUSTOM_IO : define this if you do not instantiate basic_xxx iostream
  72. * classes with custom types (which is most likely the case). Custom means types
  73. * other than char, wchar_t, char_traits<> and allocator<> like
  74. * basic_ostream<my_char_type, my_traits<my_char_type> > or
  75. * basic_string<char, char_traits<char>, my_allocator >
  76. * When this option is on, most non-inline template functions definitions for iostreams
  77. * are not seen by the client which saves a lot of compile time for most compilers,
  78. * also object and executable size for some.
  79. * Default is off, just not to break compilation for those who do use those types.
  80. * That also guarantees that you still use optimized standard i/o when you compile
  81. * your program without optimization. Option does not affect STLport library build; you
  82. * may use the same binary library with and without this option, on per-project basis.
  83. */
  84. /*
  85. #define _STLP_NO_CUSTOM_IO
  86. */
  87. /*
  88. * _STLP_NO_RELOPS_NAMESPACE: if defined, don't put the relational
  89. * operator templates (>, <=, >=, !=) in namespace std::rel_ops, even
  90. * if the compiler supports namespaces.
  91. * Note : if the compiler do not support namespaces, those operators are not be provided by default,
  92. * to simulate hiding them into rel_ops. This was proved to resolve many compiler bugs with ambiguity.
  93. */
  94. /*
  95. #define _STLP_NO_RELOPS_NAMESPACE 1
  96. */
  97. /*
  98. * If STLport use its own namespace, see _STLP_NO_OWN_NAMESPACE in host.h, it will try
  99. * by default to rename std:: for the user to stlport::. If you do not want this feature,
  100. * please define the following switch and then use stlport::
  101. */
  102. /*
  103. #define _STLP_DONT_REDEFINE_STD 1
  104. */
  105. /*
  106. * _STLP_WHOLE_NATIVE_STD : only meaningful if STLport uses its own namespace.
  107. * Normally, STLport only imports necessary components from native std:: namespace.
  108. * You might want everything from std:: being available in std:: namespace when you
  109. * include corresponding STLport header (like STLport <map> provides std::map as well, etc.),
  110. * if you are going to use both stlport:: and std:: components in your code.
  111. * Otherwise this option is not recommended as it increases the size of your object files
  112. * and slows down compilation.
  113. * Beware, if you do not use STLport iostream (_STLP_NO_IOSTREAMS above), ask STLport to
  114. * not rename std:: in stlport:: and try to have access to whole native Standard stuff then
  115. * STLport will only throw exceptions from the std namespace and not from stlport.
  116. * For instance a problem in stlport::vector::at will throw a std::out_of_range exception
  117. * and not a stlport::out_of_range.
  118. * Notice that STLport exceptions inherits from std::exception.
  119. */
  120. /*
  121. #define _STLP_WHOLE_NATIVE_STD
  122. */
  123. /*
  124. * Use this option to catch uninitialized members in your classes.
  125. * When it is set, construct() and destroy() fill the class storage
  126. * with _STLP_SHRED_BYTE (see below).
  127. * Note : _STLP_DEBUG and _STLP_DEBUG_ALLOC don't set this option automatically.
  128. */
  129. /*
  130. #define _STLP_DEBUG_UNINITIALIZED 1
  131. #define _STLP_DEBUG_ALLOC 1
  132. */
  133. /*
  134. * Uncomment and provide a definition for the byte with which raw memory
  135. * will be filled if _STLP_DEBUG_ALLOC or _STLP_DEBUG_UNINITIALIZED is defined.
  136. * Choose a value which is likely to cause a noticeable problem if dereferenced
  137. * or otherwise abused. A good value may already be defined for your platform.
  138. */
  139. /*
  140. #define _STLP_SHRED_BYTE 0xA3
  141. */
  142. /*
  143. * This option is for gcc users only and only affects systems where native linker
  144. * does not let gcc to implement automatic instantiation of static template data members/
  145. * It is being put in this file as there is no way to check if we are using GNU ld automatically,
  146. * so it becomes user's responsibility.
  147. */
  148. /*
  149. #define _STLP_GCC_USES_GNU_LD
  150. */
  151. /*==========================================================
  152. * Compatibility section
  153. *==========================================================*/
  154. /*
  155. * Define this macro to disable anachronistic constructs (like the ones used in HP STL and
  156. * not included in final standard, etc.
  157. */
  158. /*
  159. #define _STLP_NO_ANACHRONISMS 1
  160. */
  161. /*
  162. * Define this macro to disable STLport extensions (for example, to make sure your code will
  163. * compile with some other implementation )
  164. */
  165. #define _STLP_NO_EXTENSIONS 1
  166. /*
  167. * You should define this macro if compiling with MFC - STLport <stl/config/_windows.h>
  168. * then include <afx.h> instead of <windows.h> to get synchronisation primitives
  169. */
  170. /*
  171. #define _STLP_USE_MFC 1
  172. */
  173. /*
  174. * boris : this setting is here as we cannot detect precense of new Platform SDK automatically
  175. * If you are using new PSDK with VC++ 6.0 or lower,
  176. * please define this to get correct prototypes for InterlockedXXX functions
  177. */
  178. /*
  179. #define _STLP_NEW_PLATFORM_SDK 1
  180. */
  181. /*
  182. * For the same reason as the one above we are not able to detect easily use
  183. * of the compiler coming with the Platform SDK instead of the one coming with
  184. * a Microsoft Visual Studio release. This change native C/C++ library location
  185. * and implementation, please define this to get correct STLport configuration.
  186. */
  187. /*
  188. #define _STLP_USING_PLATFORM_SDK_COMPILER 1
  189. */
  190. /*
  191. * Some compilers support the automatic linking feature.
  192. * Uncomment the following if you prefer to specify the STLport library
  193. * to link with yourself.
  194. * For the moment, this feature is only supported and implemented within STLport
  195. * by the Microsoft compilers.
  196. */
  197. /*
  198. #define _STLP_DONT_USE_AUTO_LINK 1
  199. */
  200. /*
  201. * If you customize the STLport generated library names don't forget to give
  202. * the motif you used during configuration here if you still want the auto link
  203. * to work. (Do not remove double quotes in the macro value)
  204. */
  205. /*
  206. #define _STLP_LIB_NAME_MOTIF "???"
  207. */
  208. /*
  209. * Uncomment to get feedback at compilation time about result of build environment
  210. * introspection.
  211. */
  212. /*
  213. #define _STLP_VERBOSE 1
  214. */
  215. /*
  216. * Use minimum set of default arguments on template classes that have more
  217. * than one - for example map<>, set<>.
  218. * This has effect only if _STLP_LIMITED_DEFAULT_TEMPLATES is on.
  219. * If _STLP_MINIMUM_DEFAULT_TEMPLATE_PARAMS is set, you'll be able to compile
  220. * set<T> with those compilers, but you'll have to use __set__<T, less<T>>
  221. *
  222. * Affects : map<>, multimap<>, set<>, multiset<>, hash_*<>,
  223. * queue<>, priority_queue<>, stack<>, istream_iterator<>
  224. */
  225. /*
  226. #define _STLP_MINIMUM_DEFAULT_TEMPLATE_PARAMS 1
  227. */
  228. /*
  229. * The agregation of strings using the + operator is an expensive operation
  230. * as it requires construction of temporary objects that need memory allocation
  231. * and deallocation. The problem can be even more important if you are adding
  232. * several strings together in a single expression. To avoid this problem STLport
  233. * implement expression template. With this technique addition of 2 strings is not
  234. * a string anymore but a temporary object having a reference to each of the
  235. * original strings involved in the expression. This object carry information
  236. * directly to the destination string to set its size correctly and only make
  237. * a single call to the allocator. This technique also works for the addition of
  238. * N elements where elements are basic_string, C string or a single character.
  239. * The drawback can be longer compilation time and bigger executable size.
  240. * Another problem is that some compilers (gcc) fail to use string proxy object
  241. * if do with class derived from string (see unit tests for details).
  242. * STLport rebuild: Yes
  243. */
  244. /*
  245. #define _STLP_USE_TEMPLATE_EXPRESSION 1
  246. */
  247. /*
  248. * By default the STLport basic_string implementation use a little static buffer
  249. * (of 16 chars when writing this doc) to avoid systematically memory allocation
  250. * in case of little basic_string. The drawback of such a method is bigger
  251. * basic_string size and some performance penalty for method like swap. If you
  252. * prefer systematical dynamic allocation turn on this macro.
  253. * STLport rebuild: Yes
  254. */
  255. /*
  256. #define _STLP_DONT_USE_SHORT_STRING_OPTIM 1
  257. */
  258. /*
  259. * To reduce the famous code bloat trouble due to the use of templates STLport grant
  260. * a specialization of some containers for pointer types. So all instanciations
  261. * of those containers with a pointer type will use the same implementation based on
  262. * a container of void*. This feature has shown very good result on object files size
  263. * but after link phase and optimization you will only experiment benefit if you use
  264. * many container with pointer types.
  265. * There are however a number of limitation to use this option:
  266. * - with compilers not supporting partial template specialization feature, you won't
  267. * be able to access some nested container types like iterator as long as the
  268. * definition of the type used to instanciate the container will be incomplete
  269. * (see IncompleteClass definition in test/unit/vector_test.cpp).
  270. * - you won't be able to use complex Standard allocator implementations which are
  271. * allocators having pointer nested type not being a real C pointer.
  272. */
  273. /*
  274. #define _STLP_USE_PTR_SPECIALIZATIONS 1
  275. */
  276. /*
  277. * To achieve many different optimizations within the template implementations STLport
  278. * uses some type traits technique. With this macro you can ask STLport to use the famous
  279. * boost type traits rather than the internal one. The advantages are more compiler
  280. * integration and a better support. If you only define this macro once the STLport has been
  281. * built you just have to add the boost install path within your include path. If you want
  282. * to use this feature at STLport built time you will have to define the
  283. * STLP_BUILD_BOOST_PATH enrironment variable with the value of the boost library path.
  284. */
  285. /*
  286. #define _STLP_USE_BOOST_SUPPORT 1
  287. */
  288. /*==========================================================*/
  289. /*
  290. Local Variables:
  291. mode: C++
  292. End:
  293. */