PageRenderTime 61ms CodeModel.GetById 34ms RepoModel.GetById 0ms app.codeStats 0ms

/tags/harbour-1.0.0RC1/include/hbsetup.h

#
C Header | 382 lines | 197 code | 23 blank | 162 comment | 9 complexity | 066326cf16b24821a67338dba25a2a45 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 8539 2008-05-30 16:12:39Z 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. * By default this is turned on. Define HB_FM_STATISTICS_OFF to turn it off.
  82. */
  83. #ifndef HB_FM_STATISTICS_OFF
  84. #define HB_FM_STATISTICS
  85. #endif
  86. /* ***********************************************************************
  87. * Enable profiler support in HVM
  88. * By default this is turned off. Define HB_USE_PROFILER to turn it on.
  89. */
  90. #ifndef HB_USE_PROFILER
  91. #define HB_NO_PROFILER
  92. #endif
  93. /* ***********************************************************************
  94. * Use system PCRE library instead of build in. I'm setting it sometimes
  95. * when I want to use exactly the same PCRE version as installed in
  96. * a system.
  97. */
  98. /* #define HB_PCRE_REGEX */
  99. /* ***********************************************************************
  100. * Use old PCRE library which is part of BCC CRTL used to emulate
  101. * POSIX regex.
  102. */
  103. /* #define HB_PCRE_REGEX_BCC */
  104. /* ***********************************************************************
  105. * Use POSIX regex library which should be part of each POSIX compatible
  106. * system / C compiler I also use this when I want to support exactly
  107. * the same regular expressions as other tools installed in the system
  108. */
  109. /* #define HB_POSIX_REGEX */
  110. /* ***********************************************************************
  111. * This symbol defines if Harbour is compiled using C compiler
  112. * that support strict ANSI C only
  113. *
  114. * The only non ANSI C feature that we are using is an ability
  115. * to call functions before the 'main' module is called.
  116. * This trick is used to automatically join all symbol tables defined
  117. * in run-time support modules and in user defined modules.
  118. * If strict ANSI C compability is required then all symbol tables
  119. * have to be joined manually by calling special function named
  120. * hb_vm_SymbolInit_<module_name>
  121. * (for example for myfirst.prg it will be: 'hb_vm_SymbolInit_MYFIRST'
  122. * The generation of this function is performed by the macro called
  123. * HB_CALL_ON_STARTUP that is defined in 'hbinit.h'
  124. *
  125. * By default we are using extensions to ANSI C (symbol is not defined)
  126. */
  127. /* #define HB_STRICT_ANSI_C */
  128. /* ***********************************************************************
  129. * Define this option if you want the /y YACC trace option to be available
  130. * in the Harbour compiler.
  131. *
  132. * Note that if you turn this on, the compiler will slighly grow in size.
  133. *
  134. * By default this is turned off.
  135. */
  136. /* #define HB_YYDEBUG */
  137. /* ***********************************************************************
  138. * Use native Windows memory allocation functions (HB_OS_WIN_32)
  139. * This option can disable compiler memory allocation optimization
  140. * so you should really have a good reason to enable it
  141. */
  142. /* #define HB_FM_WIN32_ALLOC */
  143. /* ***********************************************************************
  144. * You can select here, what type of main entry will be used in the
  145. * application (main() or WinMain()).
  146. *
  147. * By default the standard C main() function will be used.
  148. */
  149. /* #define HARBOUR_MAIN_STD */
  150. /* #define HARBOUR_MAIN_WIN */
  151. /* ***********************************************************************
  152. * You can set here the maximum symbol name length handled by Harbour
  153. * compiler and runtime. You can override this setting in the make process.
  154. * Setting this too low, may result in clashing symbols in Harbour
  155. * itself. For strict CA-Cl*pper compatibility a value of 10 would have
  156. * to be used, but Harbour won't properly compile using this setting.
  157. *
  158. * By default this value is 63
  159. */
  160. #ifndef HB_SYMBOL_NAME_LEN
  161. #define HB_SYMBOL_NAME_LEN 63
  162. #endif
  163. /* ***********************************************************************
  164. * You can enable here support for multiline strings concatenated by ';'
  165. * f.e.:
  166. * cVar := "line 1;
  167. * line 2;
  168. * line 3"
  169. * It's not Clipper compatible extension and it's not enabled by default
  170. * anyhow old Harbour PP worked in such way and people may have some code
  171. * which needs it
  172. */
  173. /* #define HB_PP_MULTILINE_STRING */
  174. /* ***********************************************************************
  175. * Detect GCC/OS2
  176. */
  177. #if defined(__EMX__) && ! defined(__RSXNT__)
  178. #define HARBOUR_GCC_OS2
  179. #endif
  180. /* ***********************************************************************
  181. * Operating system specific definitions
  182. */
  183. #if ( defined(__GNUC__) && \
  184. ! ( defined(__DJGPP__) || defined(__EMX__) || defined(__RSXNT__) || \
  185. defined(_Windows) || defined(_WIN32) || defined(_WINCE) ) ) || \
  186. ( defined(__WATCOMC__) && defined(__LINUX__) )
  187. #define OS_UNIX_COMPATIBLE
  188. #define OS_PATH_LIST_SEPARATOR ':'
  189. #define OS_PATH_DELIMITER '/'
  190. #define OS_PATH_DELIMITER_STRING "/"
  191. #define OS_PATH_DELIMITER_LIST "/"
  192. #define OS_FILE_MASK "*"
  193. #undef OS_DRIVE_DELIMITER
  194. #undef OS_HAS_DRIVE_LETTER
  195. #define OS_OPT_DELIMITER_LIST "-"
  196. #define OS_EOL_LEN 1
  197. #else
  198. /* we are assuming here the DOS compatible OS */
  199. #define OS_DOS_COMPATIBLE
  200. #define OS_PATH_LIST_SEPARATOR ';'
  201. #define OS_PATH_DELIMITER '\\'
  202. #define OS_PATH_DELIMITER_STRING "\\"
  203. #define OS_PATH_DELIMITER_LIST "\\/:"
  204. #define OS_FILE_MASK "*.*"
  205. #define OS_DRIVE_DELIMITER ':'
  206. #define OS_HAS_DRIVE_LETTER
  207. #define OS_OPT_DELIMITER_LIST "/-"
  208. #define OS_EOL_LEN 2 /* # of bytes in End of Line marker */
  209. #endif
  210. #ifndef _POSIX_PATH_MAX
  211. #define _POSIX_PATH_MAX 255
  212. #endif
  213. #define HB_ISOPTSEP( c ) ( strchr( OS_OPT_DELIMITER_LIST, ( c ) ) != NULL )
  214. /* ***********************************************************************
  215. * Platform detection
  216. */
  217. #if defined(__WATCOMC__)
  218. #if defined(__OS2__)
  219. #define HB_OS_OS2
  220. #elif defined(__NT__) || defined(__WINDOWS_386__) || defined(__WINDOWS__)
  221. #define HB_OS_WIN_32
  222. #elif defined(__LINUX__)
  223. #define HB_OS_LINUX
  224. #elif defined(__386__)
  225. #define HB_OS_DOS
  226. #define HB_OS_DOS_32
  227. #else
  228. #define HB_OS_DOS
  229. #define HB_OS_DOS_16
  230. #endif
  231. #endif
  232. #ifndef HB_OS_DOS
  233. #if defined(DOS) || defined(_QC) || defined(__DOS__) || defined(MSDOS) || defined(__MSDOS__) || defined(__RSX32__)
  234. #define HB_OS_DOS
  235. #if defined(__386__) || defined(__DJGPP__)
  236. #define HB_OS_DOS_32
  237. #else
  238. #define HB_OS_DOS_16
  239. #endif
  240. #endif
  241. #endif
  242. #ifndef HB_OS_OS2
  243. #if defined(OS2) || defined(__OS2__) || defined(OS_2) || defined(HARBOUR_GCC_OS2)
  244. #define HB_OS_OS2
  245. #if defined(__EMX__)
  246. #define HB_OS_OS2_EMX
  247. #endif
  248. #endif
  249. #endif
  250. #ifndef HB_OS_WIN_32
  251. #if defined(WINNT) || defined(_Windows) || defined(__NT__) || defined(_WIN32) || defined(_WINDOWS_) || defined(__WINDOWS_386__) || defined(__WIN32__) || defined(__CYGWIN__)
  252. #define HB_OS_WIN_32
  253. #endif
  254. #endif
  255. #if !defined(HB_WINCE) && \
  256. ( defined(_WINCE) || defined(__CEGCC__) || defined(__MINGW32CE__) )
  257. #define HB_WINCE
  258. #endif
  259. #ifndef HB_OS_LINUX
  260. #if defined(linux) || defined(__linux) || defined(__linux__)
  261. #define HB_OS_LINUX
  262. #endif
  263. #endif
  264. #ifndef HB_OS_SUNOS
  265. #if defined(sun) || defined(__sun)
  266. #define HB_OS_SUNOS
  267. #endif
  268. #endif
  269. #ifndef HB_OS_HPUX
  270. #if defined(__hpux)
  271. #define HB_OS_HPUX
  272. #endif
  273. #endif
  274. #ifndef HB_OS_BSD
  275. #if defined( __FreeBSD__ ) || defined( __NetBSD__ ) || defined( __OpenBSD__ ) || \
  276. defined( __APPLE__ ) || defined( HB_OS_DARWIN )
  277. #define HB_OS_BSD
  278. #endif
  279. #endif
  280. #ifndef HB_OS_UNIX
  281. #if defined(OS_UNIX_COMPATIBLE) || defined(HB_OS_LINUX) || \
  282. defined(HB_OS_BSD) || defined(HB_OS_SUNOS) || defined(HB_OS_HPUX)
  283. #define HB_OS_UNIX
  284. #endif
  285. #endif
  286. #ifndef HB_OS_MAC
  287. #if defined(__MPW__)
  288. #define HB_OS_MAC
  289. #endif
  290. #endif
  291. /* ***********************************************************************
  292. * Here you can force the EOL string to be CRLF
  293. *
  294. * By default, the EOL string depends upon the detected platform.
  295. */
  296. /* #define HB_EOL_CRLF */
  297. #ifdef HB_EOL_CRLF
  298. #undef OS_EOL_LEN
  299. #define OS_EOL_LEN 2
  300. #endif
  301. /* ***********************************************************************
  302. * See also the following files for task specific definitions/settings
  303. *
  304. * hbmath.h - math errors handling
  305. */
  306. /* ***********************************************************************
  307. * some fixes in compiler header files
  308. */
  309. #if defined( __DJGPP__ )
  310. /* Fix DJGPP in call to: toupper(), tolower(), is...()
  311. */
  312. #include "hbfixdj.h"
  313. /* Substitute snprintf() by sprintf() for DJGPP <= 2.03.
  314. * This is a temporary hack, should implement a C99 snprintf() ourselves.
  315. */
  316. #if ( __DJGPP__ < 2 || ( __DJGPP__ == 2 && __DJGPP_MINOR__ <= 3 ) )
  317. #define snprintf(s, len, args...) sprintf( (s), ##args )
  318. #endif
  319. #elif defined( _MSC_VER ) && !defined( __XCC__ )
  320. #define snprintf _snprintf
  321. #elif defined( __WATCOMC__ )
  322. #if __WATCOMC__ < 1200
  323. #define snprintf _bprintf
  324. #endif
  325. #endif
  326. /* ***********************************************************************
  327. * Extern "C" detection
  328. */
  329. #if defined(__cplusplus) && !defined(__IBMCPP__)
  330. #define HB_EXTERN_C
  331. #define HB_EXTERN_BEGIN extern "C" {
  332. #define HB_EXTERN_END }
  333. #else
  334. #define HB_EXTERN_BEGIN
  335. #define HB_EXTERN_END
  336. #endif
  337. #endif /* HB_SETUP_H_ */