PageRenderTime 50ms CodeModel.GetById 23ms RepoModel.GetById 0ms app.codeStats 0ms

/tags/harbour-1.0.1/include/hbsetup.h

#
C Header | 411 lines | 231 code | 22 blank | 158 comment | 8 complexity | 7619b656e5a420e33b1bc4ba2cc488f8 MD5 | raw file
Possible License(s): AGPL-1.0, BSD-3-Clause, CC-BY-SA-3.0, LGPL-3.0, GPL-2.0, LGPL-2.0, LGPL-2.1
  1. /*
  2. * $Id: hbsetup.h 9384 2008-09-14 14:00:31Z vszakats $
  3. */
  4. /*
  5. * Harbour Project source code:
  6. * Header file for compiler and runtime configuration
  7. *
  8. * Copyright 1999 Ryszard Glab <rglab@imid.med.pl>
  9. * www - http://www.harbour-project.org
  10. *
  11. * This program is free software; you can redistribute it and/or modify
  12. * it under the terms of the GNU General Public License as published by
  13. * the Free Software Foundation; either version 2, or (at your option)
  14. * any later version.
  15. *
  16. * This program is distributed in the hope that it will be useful,
  17. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. * GNU General Public License for more details.
  20. *
  21. * You should have received a copy of the GNU General Public License
  22. * along with this software; see the file COPYING. If not, write to
  23. * the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
  24. * Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
  25. *
  26. * As a special exception, the Harbour Project gives permission for
  27. * additional uses of the text contained in its release of Harbour.
  28. *
  29. * The exception is that, if you link the Harbour libraries with other
  30. * files to produce an executable, this does not by itself cause the
  31. * resulting executable to be covered by the GNU General Public License.
  32. * Your use of that executable is in no way restricted on account of
  33. * linking the Harbour library code into it.
  34. *
  35. * This exception does not however invalidate any other reasons why
  36. * the executable file might be covered by the GNU General Public License.
  37. *
  38. * This exception applies only to the code released by the Harbour
  39. * Project under the name Harbour. If you copy code from other
  40. * Harbour Project or Free Software Foundation releases into a copy of
  41. * Harbour, as the General Public License permits, the exception does
  42. * not apply to the code that you add in this way. To avoid misleading
  43. * anyone as to the status of such modified files, you must delete
  44. * this exception notice from them.
  45. *
  46. * If you write modifications of your own for Harbour, it is your choice
  47. * whether to permit this exception to apply to your modifications.
  48. * If you do not wish that, delete this exception notice.
  49. *
  50. */
  51. #ifndef HB_SETUP_H_
  52. #define HB_SETUP_H_
  53. #include <limits.h>
  54. /* ***********************************************************************
  55. * Include settings common for .prg and .c files
  56. */
  57. #include "hbsetup.ch"
  58. /* ***********************************************************************
  59. * Define PCODE version number
  60. * HB_PCODE_VER_MIN define minimum supported PCODE by HVM
  61. */
  62. #define HB_PCODE_VER 0x0002
  63. #define HB_PCODE_VER_MIN 0x0002
  64. /* ***********************************************************************
  65. * NOTE: You can select the default language modul used by Harbour, by
  66. * defining this to a valid language modul identifier.
  67. */
  68. #ifndef HB_LANG_DEFAULT
  69. #define HB_LANG_DEFAULT EN
  70. #endif
  71. /* ***********************************************************************
  72. * If you turn this on, the memory subsystem will collect trace information
  73. * and several statistical data about memory management, it will show
  74. * these on exit if memory seem to have been leaked. The memory subsystem
  75. * will also do pointer checks. [vszakats]
  76. * This should be normally turned off in a final release.
  77. *
  78. * Note that if you turn this on, Harbour will be slighlty slower, larger
  79. * and will consume more memory.
  80. */
  81. /* #define HB_FM_STATISTICS */
  82. /* ***********************************************************************
  83. * Enable profiler support in HVM
  84. * By default this is turned off. Define HB_USE_PROFILER to turn it on.
  85. */
  86. #ifndef HB_USE_PROFILER
  87. #define HB_NO_PROFILER
  88. #endif
  89. /* ***********************************************************************
  90. * Use system PCRE library instead of build in. I'm setting it sometimes
  91. * when I want to use exactly the same PCRE version as installed in
  92. * a system.
  93. */
  94. /* #define HB_PCRE_REGEX */
  95. /* ***********************************************************************
  96. * Use old PCRE library which is part of BCC CRTL used to emulate
  97. * POSIX regex.
  98. */
  99. /* #define HB_PCRE_REGEX_BCC */
  100. /* ***********************************************************************
  101. * Use POSIX regex library which should be part of each POSIX compatible
  102. * system / C compiler I also use this when I want to support exactly
  103. * the same regular expressions as other tools installed in the system
  104. */
  105. /* #define HB_POSIX_REGEX */
  106. /* ***********************************************************************
  107. * This symbol defines if Harbour is compiled using C compiler
  108. * that support strict ANSI C only
  109. *
  110. * The only non ANSI C feature that we are using is an ability
  111. * to call functions before the 'main' module is called.
  112. * This trick is used to automatically join all symbol tables defined
  113. * in run-time support modules and in user defined modules.
  114. * If strict ANSI C compability is required then all symbol tables
  115. * have to be joined manually by calling special function named
  116. * hb_vm_SymbolInit_<module_name>
  117. * (for example for myfirst.prg it will be: 'hb_vm_SymbolInit_MYFIRST'
  118. * The generation of this function is performed by the macro called
  119. * HB_CALL_ON_STARTUP that is defined in 'hbinit.h'
  120. *
  121. * By default we are using extensions to ANSI C (symbol is not defined)
  122. */
  123. /* #define HB_STRICT_ANSI_C */
  124. /* ***********************************************************************
  125. * Define this option if you want the /y YACC trace option to be available
  126. * in the Harbour compiler.
  127. *
  128. * Note that if you turn this on, the compiler will slighly grow in size.
  129. *
  130. * By default this is turned off.
  131. */
  132. /* #define HB_YYDEBUG */
  133. /* ***********************************************************************
  134. * Use native Windows memory allocation functions (HB_OS_WIN_32)
  135. * This option can disable compiler memory allocation optimization
  136. * so you should really have a good reason to enable it
  137. */
  138. /* #define HB_FM_WIN32_ALLOC */
  139. /* ***********************************************************************
  140. * You can select here, what type of main entry will be used in the
  141. * application (main() or WinMain()).
  142. *
  143. * By default the standard C main() function will be used.
  144. */
  145. /* #define HB_MAIN_STD */
  146. /* #define HB_MAIN_WIN */
  147. /* ***********************************************************************
  148. * You can set here the maximum symbol name length handled by Harbour
  149. * compiler and runtime. You can override this setting in the make process.
  150. * Setting this too low, may result in clashing symbols in Harbour
  151. * itself. For strict CA-Cl*pper compatibility a value of 10 would have
  152. * to be used, but Harbour won't properly compile using this setting.
  153. *
  154. * By default this value is 63
  155. */
  156. #ifndef HB_SYMBOL_NAME_LEN
  157. #define HB_SYMBOL_NAME_LEN 63
  158. #endif
  159. /* ***********************************************************************
  160. * You can enable here support for multiline strings concatenated by ';'
  161. * f.e.:
  162. * cVar := "line 1;
  163. * line 2;
  164. * line 3"
  165. * It's not Clipper compatible extension and it's not enabled by default
  166. * anyhow old Harbour PP worked in such way and people may have some code
  167. * which needs it
  168. */
  169. /* #define HB_PP_MULTILINE_STRING */
  170. /* ***********************************************************************
  171. * Operating system specific definitions
  172. */
  173. #if ( defined(__GNUC__) && \
  174. ! ( defined(__DJGPP__) || defined(__EMX__) || defined(__RSXNT__) || \
  175. defined(_Windows) || defined(_WIN32) || defined(_WINCE) ) ) || \
  176. ( defined(__WATCOMC__) && defined(__LINUX__) )
  177. #define HB_OS_UNIX_COMPATIBLE
  178. #define HB_OS_PATH_LIST_SEP_CHR ':'
  179. #define HB_OS_PATH_DELIM_CHR '/'
  180. #define HB_OS_PATH_DELIM_CHR_STRING "/"
  181. #define HB_OS_PATH_DELIM_CHR_LIST "/"
  182. #define HB_OS_ALLFILE_MASK "*"
  183. #undef HB_OS_DRIVE_DELIM_CHR
  184. #undef HB_OS_HAS_DRIVE_LETTER
  185. #define HB_OS_OPT_DELIM_LIST "-"
  186. #define HB_OS_EOL_LEN 1
  187. #else
  188. /* we are assuming here the DOS compatible OS */
  189. #define HB_OS_PATH_LIST_SEP_CHR ';'
  190. #define HB_OS_PATH_DELIM_CHR '\\'
  191. #define HB_OS_PATH_DELIM_CHR_STRING "\\"
  192. #define HB_OS_PATH_DELIM_CHR_LIST "\\/:"
  193. #define HB_OS_ALLFILE_MASK "*.*"
  194. #define HB_OS_DRIVE_DELIM_CHR ':'
  195. #define HB_OS_HAS_DRIVE_LETTER
  196. #define HB_OS_OPT_DELIM_LIST "/-"
  197. #define HB_OS_EOL_LEN 2 /* # of bytes in End of Line marker */
  198. #endif
  199. #ifndef _POSIX_PATH_MAX
  200. #define _POSIX_PATH_MAX 255
  201. #endif
  202. #define HB_ISOPTSEP( c ) ( strchr( HB_OS_OPT_DELIM_LIST, ( c ) ) != NULL )
  203. /* NOTE:
  204. Compiler _MSC_VER value
  205. -------- --------------
  206. C Compiler version 6.0 600
  207. C/C++ compiler version 7.0 700
  208. Visual C++, Windows, version 1.0 800
  209. Visual C++, 32-bit, version 1.0 800
  210. Visual C++, Windows, version 2.0 900
  211. Visual C++, 32-bit, version 2.x 900
  212. Visual C++, 32-bit, version 4.0 1000
  213. Visual C++, 32-bit, version 5.0 1100
  214. Visual C++, 32-bit, version 6.0 1200
  215. Visual Studio .NET, version 7.0 1300
  216. Visual Studio .NET 2003, version 7.1 1310
  217. Visual Studio 2005, version 8.0 1400
  218. Visual Studio 2008, version 9.0 1500
  219. */
  220. /* ***********************************************************************
  221. * Platform detection
  222. */
  223. #if defined(__WATCOMC__)
  224. #if defined(__OS2__)
  225. #define HB_OS_OS2
  226. #elif defined(__NT__) || defined(__WINDOWS_386__) || defined(__WINDOWS__)
  227. #define HB_OS_WIN_32
  228. #elif defined(__LINUX__)
  229. #define HB_OS_LINUX
  230. #elif defined(__386__)
  231. #define HB_OS_DOS
  232. #define HB_OS_DOS_32
  233. #else
  234. #define HB_OS_DOS
  235. #define HB_OS_DOS_16
  236. #endif
  237. #endif
  238. #ifndef HB_OS_DOS
  239. #if defined(DOS) || defined(_QC) || defined(__DOS__) || defined(MSDOS) || defined(__MSDOS__) || defined(__RSX32__)
  240. #define HB_OS_DOS
  241. #if defined(__386__) || defined(__DJGPP__)
  242. #define HB_OS_DOS_32
  243. #else
  244. #define HB_OS_DOS_16
  245. #endif
  246. #endif
  247. #endif
  248. #if defined(__EMX__) && ! defined(__RSXNT__)
  249. #define HB_OS_OS2_GCC
  250. #endif
  251. #ifndef HB_OS_OS2
  252. #if defined(OS2) || defined(__OS2__) || defined(OS_2) || defined(HB_OS_OS2_GCC)
  253. #define HB_OS_OS2
  254. #endif
  255. #endif
  256. #ifndef HB_OS_WIN_32
  257. #if defined(WINNT) || defined(_Windows) || defined(__NT__) || defined(_WIN32) || defined(_WINDOWS_) || defined(__WINDOWS_386__) || defined(__WIN32__) || defined(__CYGWIN__)
  258. #define HB_OS_WIN_32
  259. #endif
  260. #endif
  261. /* Sub-option inside HB_OS_WIN_32 */
  262. #ifndef HB_OS_WIN_64
  263. #if defined(_WIN64)
  264. #define HB_OS_WIN_64
  265. #endif
  266. #endif
  267. /* Sub-option inside HB_OS_WIN_32 */
  268. #ifndef HB_WINCE
  269. #if defined(_WINCE) || defined(__CEGCC__) || defined(__MINGW32CE__) || (defined(__POCC_TARGET__) && __POCC_TARGET__ == 2)
  270. #define HB_WINCE
  271. #endif
  272. #endif
  273. #ifndef HB_OS_LINUX
  274. #if defined(linux) || defined(__linux) || defined(__linux__) || defined(__gnu_linux__)
  275. #define HB_OS_LINUX
  276. #endif
  277. #endif
  278. #ifndef HB_OS_SUNOS
  279. #if defined(sun) || defined(__sun) || defined(__sun__)
  280. #define HB_OS_SUNOS
  281. #endif
  282. #endif
  283. #ifndef HB_OS_HPUX
  284. /* HP cc in ANSI mode defines __hpux. GCC defines __hpux__ */
  285. #if defined(__hpux) || defined(__hpux__)
  286. #define HB_OS_HPUX
  287. #endif
  288. #endif
  289. #ifndef HB_OS_DARWIN
  290. #if defined(__APPLE__)
  291. #define HB_OS_DARWIN
  292. #endif
  293. #endif
  294. #ifndef HB_OS_BSD
  295. #if defined( __FreeBSD__ ) || defined( __NetBSD__ ) || defined( __OpenBSD__ ) || \
  296. defined( HB_OS_DARWIN )
  297. #define HB_OS_BSD
  298. #endif
  299. #endif
  300. #ifndef HB_OS_UNIX
  301. #if defined(HB_OS_UNIX_COMPATIBLE) || \
  302. defined(HB_OS_LINUX) || \
  303. defined(HB_OS_DARWIN) || \
  304. defined(HB_OS_BSD) || \
  305. defined(HB_OS_SUNOS) || \
  306. defined(HB_OS_HPUX)
  307. #define HB_OS_UNIX
  308. #endif
  309. #endif
  310. /* ***********************************************************************
  311. * Here you can force the EOL string to be CRLF
  312. *
  313. * By default, the EOL string depends upon the detected platform.
  314. */
  315. /* #define HB_EOL_CRLF */
  316. #ifdef HB_EOL_CRLF
  317. #undef HB_OS_EOL_LEN
  318. #define HB_OS_EOL_LEN 2
  319. #endif
  320. /* Compatibility #defines. These will be removed, so
  321. please use the new names in your code. */
  322. #ifdef HB_LEGACY_LEVEL
  323. #define OS_PATH_DELIMITER HB_OS_PATH_DELIM_CHR
  324. #ifdef HB_OS_UNIX_COMPATIBLE
  325. #define OS_UNIX_COMPATIBLE
  326. #endif
  327. #endif
  328. /* ***********************************************************************
  329. * See also the following files for task specific definitions/settings
  330. *
  331. * hbmath.h - math errors handling
  332. */
  333. /* ***********************************************************************
  334. * some fixes in compiler header files
  335. */
  336. #if defined( __DJGPP__ )
  337. /* Fix DJGPP in call to: toupper(), tolower(), is...()
  338. */
  339. #include "hbfixdj.h"
  340. /* Substitute snprintf() by sprintf() for DJGPP <= 2.03.
  341. * This is a temporary hack, should implement a C99 snprintf() ourselves.
  342. */
  343. #if ( __DJGPP__ < 2 || ( __DJGPP__ == 2 && __DJGPP_MINOR__ <= 3 ) )
  344. #define snprintf(s, len, args...) sprintf( (s), ##args )
  345. #endif
  346. #elif defined( _MSC_VER ) || defined( __DMC__ ) && !defined( __XCC__ )
  347. #define snprintf _snprintf
  348. #elif defined( __WATCOMC__ )
  349. #if __WATCOMC__ < 1200
  350. #define snprintf _bprintf
  351. #endif
  352. #endif
  353. /* ***********************************************************************
  354. * Extern "C" detection
  355. */
  356. #if defined(__cplusplus) && !defined(__IBMCPP__)
  357. #define HB_EXTERN_C
  358. #define HB_EXTERN_BEGIN extern "C" {
  359. #define HB_EXTERN_END }
  360. #else
  361. #define HB_EXTERN_BEGIN
  362. #define HB_EXTERN_END
  363. #endif
  364. #endif /* HB_SETUP_H_ */