dbf_common.inc 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  1. // define this if you need more SPEEEEEDDDD!!!
  2. // useful if you index dbf files over a network
  3. {.$define USE_CACHE}
  4. // define the following if you want support for 65535 length character
  5. // fields for all dbase files (and not only foxpro); if you define this,
  6. // you will not be able to read MS Excel generated .dbf files!
  7. {.$define USE_LONG_CHAR_FIELDS}
  8. // modifies unix unit dbf_wtil to use hungarian encodings (hack)
  9. {.$define HUNGARIAN}
  10. // enables assembler routines, 486+ only
  11. {$define USE_ASSEMBLER_486_UP}
  12. // test compatibility
  13. {.$define TDBF_UPDATE_FIRSTLAST_NODE}
  14. // use this directive to suppress math exceptions,
  15. // instead NAN is returned.
  16. // Using this directive is slightly less efficient
  17. //
  18. // used in Dbf_PrsDef
  19. //
  20. // NAN support needs to be rewritten and is currently absent
  21. {.$define NAN}
  22. //------------------------------------------------------
  23. //--- Define all SUPPORT_xxx; undef if not supported ---
  24. //------------------------------------------------------
  25. //------------------------------------------------------
  26. //--- Delphi versions ---
  27. //------------------------------------------------------
  28. {$ifdef VER80} // Delphi 1.0
  29. #ERROR tDbf needs Delphi or C++ Builder 3 minimum.
  30. {$endif}
  31. {$ifdef VER90} // Delphi 2.0
  32. #ERROR tDbf needs Delphi or C++ Builder 3 minimum.
  33. {$endif}
  34. {$ifdef VER93} // is BCB++ 1.0
  35. #ERROR tDbf needs Delphi or C++ Builder 3 minimum.
  36. {$endif}
  37. {$ifdef VER100} // Delphi 3
  38. {$define DELPHI_3}
  39. {$endif}
  40. {$ifdef VER110} // CBuilder 3
  41. {$define DELPHI_3}
  42. {$endif}
  43. {$ifdef VER120} // Delphi 4
  44. {$define DELPHI_4}
  45. {$define DELPHI_3}
  46. {$endif}
  47. {$ifdef VER125} // C++ BUILDER 4
  48. {$define DELPHI_4}
  49. {$define DELPHI_3}
  50. {$endif}
  51. {$ifdef VER130} // Delphi 5
  52. {$define DELPHI_5}
  53. {$define DELPHI_4}
  54. {$define DELPHI_3}
  55. {$endif}
  56. {$ifdef VER135} // C++ Builder 5 ??
  57. {$define DELPHI_5}
  58. {$define DELPHI_4}
  59. {$define DELPHI_3}
  60. {$endif}
  61. {$ifdef VER140} // Delphi 6
  62. {$define DELPHI_6}
  63. {$define DELPHI_5}
  64. {$define DELPHI_4}
  65. {$define DELPHI_3}
  66. {$endif}
  67. {$ifdef VER145} // C++ Builder 6
  68. {$define DELPHI_6}
  69. {$define DELPHI_5}
  70. {$define DELPHI_4}
  71. {$define DELPHI_3}
  72. {$endif}
  73. {$ifdef VER150} // Delphi 7 :-) For once I am not late (12/07/2001)
  74. {$define DELPHI_7}
  75. {$define DELPHI_6}
  76. {$define DELPHI_5}
  77. {$define DELPHI_4}
  78. {$define DELPHI_3}
  79. {$endif}
  80. {$ifdef VER155} // C++ Builder 7
  81. {$define DELPHI_7}
  82. {$define DELPHI_6}
  83. {$define DELPHI_5}
  84. {$define DELPHI_4}
  85. {$define DELPHI_3}
  86. {$endif}
  87. {$ifdef VER160} // Delphi 8
  88. {$define DELPHI_2005}
  89. {$define DELPHI_8}
  90. {$define DELPHI_7}
  91. {$define DELPHI_6}
  92. {$define DELPHI_5}
  93. {$define DELPHI_4}
  94. {$define DELPHI_3}
  95. {$endif}
  96. {$ifdef VER170} // Delphi 2005
  97. {$define DELPHI_2005}
  98. {$define DELPHI_8}
  99. {$define DELPHI_7}
  100. {$define DELPHI_6}
  101. {$define DELPHI_5}
  102. {$define DELPHI_4}
  103. {$define DELPHI_3}
  104. {$endif}
  105. {$ifdef VER180} // Delphi 2006
  106. {$define DELPHI_2006}
  107. {$define DELPHI_2005}
  108. {$define DELPHI_8}
  109. {$define DELPHI_7}
  110. {$define DELPHI_6}
  111. {$define DELPHI_5}
  112. {$define DELPHI_4}
  113. {$define DELPHI_3}
  114. {$endif}
  115. {$ifdef VER190} // Delphi 2007
  116. {$define DELPHI_2007}
  117. {$define DELPHI_2006}
  118. {$define DELPHI_2005}
  119. {$define DELPHI_8}
  120. {$define DELPHI_7}
  121. {$define DELPHI_6}
  122. {$define DELPHI_5}
  123. {$define DELPHI_4}
  124. {$define DELPHI_3}
  125. {$endif}
  126. //-------------------------------------------------------
  127. //--- Conclude supported features from delphi version ---
  128. //-------------------------------------------------------
  129. {$ifdef DELPHI_3}
  130. {$define SUPPORT_VARIANTS}
  131. {$ifdef DELPHI_4}
  132. {$define SUPPORT_DEFCHANGED}
  133. {$define SUPPORT_DEFAULT_PARAMS}
  134. {$define SUPPORT_NEW_TRANSLATE}
  135. {$define SUPPORT_INT64}
  136. {$define SUPPORT_REINTRODUCE}
  137. {$define SUPPORT_FIELDDEFS_UPDATED}
  138. {$define SUPPORT_FIELDDEF_ATTRIBUTES}
  139. {$define SUPPORT_FIELDDEF_TPERSISTENT}
  140. {$define SUPPORT_FIELDDEF_INDEX}
  141. {$define SUPPORT_FIELDTYPES_V4}
  142. {$define SUPPORT_UINT32_CARDINAL}
  143. {$define SUPPORT_MATH_UNIT}
  144. {$ifdef DELPHI_5}
  145. {$define SUPPORT_BACKWARD_FIELDDATA}
  146. {$define SUPPORT_NEW_FIELDDATA}
  147. {$define SUPPORT_INITDEFSFROMFIELDS}
  148. {$define SUPPORT_DEF_DELETE}
  149. {$define SUPPORT_FREEANDNIL}
  150. {$ifdef DELPHI_6}
  151. {$define SUPPORT_PATHDELIM}
  152. {$define SUPPORT_SEPARATE_VARIANTS_UNIT}
  153. {$endif}
  154. {$endif}
  155. {$endif}
  156. {$endif}
  157. //------------------------------------------------------
  158. //--- Conclude supported features in FreePascal ---
  159. //------------------------------------------------------
  160. {$ifdef FPC_VERSION}
  161. {$mode delphi}
  162. {$h+}
  163. {$ifndef CPUI386}
  164. {$undef USE_ASSEMBLER_486_UP}
  165. {$endif}
  166. {$ifndef FPC_LITTLE_ENDIAN}
  167. {$message error TDbf is not compatible with non little-endian CPUs. Please contact the author.}
  168. {$endif}
  169. {$ifdef USE_ASSEMBLER_486_UP}
  170. {$asmmode intel}
  171. {$endif}
  172. {$define SUPPORT_INT64}
  173. {$define SUPPORT_DEFAULT_PARAMS}
  174. {$define SUPPORT_NEW_TRANSLATE}
  175. {$define SUPPORT_NEW_FIELDDATA}
  176. {$define SUPPORT_FIELDDEF_TPERSISTENT}
  177. {$define SUPPORT_FIELDTYPES_V4}
  178. {$define SUPPORT_UINT32_CARDINAL}
  179. {$define SUPPORT_REINTRODUCE}
  180. {$define SUPPORT_MATH_UNIT}
  181. {$define SUPPORT_VARIANTS}
  182. {$define SUPPORT_SEPARATE_VARIANTS_UNIT}
  183. // FPC 2.0.x improvements
  184. {$ifdef VER2}
  185. {$ifndef VER2_0_0}
  186. {$define SUPPORT_BACKWARD_FIELDDATA}
  187. {$endif}
  188. {$endif}
  189. // FPC 1.0.x exceptions: no 0/0 support
  190. {$ifdef VER1_0}
  191. {$undef NAN}
  192. {$undef SUPPORT_DEFAULT_PARAMS}
  193. {$undef SUPPORT_NEW_TRANSLATE}
  194. {$message error TDbf needs fpc 1.9 minimum.}
  195. {$endif}
  196. {$endif}
  197. //----------------------------------------------------------
  198. //--- Conclude supported features in non-Win32 platforms ---
  199. //----------------------------------------------------------
  200. {$ifndef WIN32}
  201. {$define SUPPORT_PATHDELIM}
  202. {$define SUPPORT_INCLUDETRAILPATHDELIM}
  203. {$define SUPPORT_INCLUDETRAILBACKSLASH}
  204. {$endif}