dbf_common.inc 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. // define this if you need more SPEEEEEDDDD!!!
  2. // useful if you index dbf files over a network
  3. {.$define USE_CACHE}
  4. // enables assembler routines, 486+ only
  5. {$define USE_ASSEMBLER_486_UP}
  6. // test compatibility
  7. {.$define TDBF_UPDATE_FIRSTLAST_NODE}
  8. // use this to enable the lookup function which is still buggy
  9. {.$define USE_BUGGY_LOOKUP}
  10. // use this directive to suppress math exceptions,
  11. // instead NAN is returned.
  12. // Using this directive is slightly less efficient
  13. //
  14. // used in Dbf_PrsDef
  15. //
  16. // NAN support needs to be rewritten and is currently absent
  17. {.$define NAN}
  18. //------------------------------------------------------
  19. //--- Define all SUPPORT_xxx; undef if not supported ---
  20. //------------------------------------------------------
  21. //------------------------------------------------------
  22. //--- Delphi versions ---
  23. //------------------------------------------------------
  24. {$ifdef VER80} // Delphi 1.0
  25. #ERROR tDbf needs Delphi or C++ Builder 3 minimum.
  26. {$endif}
  27. {$ifdef VER90} // Delphi 2.0
  28. #ERROR tDbf needs Delphi or C++ Builder 3 minimum.
  29. {$endif}
  30. {$ifdef VER93} // is BCB++ 1.0
  31. #ERROR tDbf needs Delphi or C++ Builder 3 minimum.
  32. {$endif}
  33. {$ifdef VER100} // Delphi 3
  34. {$define DELPHI_3}
  35. {$endif}
  36. {$ifdef VER110} // CBuilder 3
  37. {$define DELPHI_3}
  38. {$endif}
  39. {$ifdef VER120} // Delphi 4
  40. {$define DELPHI_4}
  41. {$define DELPHI_3}
  42. {$endif}
  43. {$ifdef VER125} // C++ BUILDER 4
  44. {$define DELPHI_4}
  45. {$define DELPHI_3}
  46. {$endif}
  47. {$ifdef VER130} // Delphi 5
  48. {$define DELPHI_5}
  49. {$define DELPHI_4}
  50. {$define DELPHI_3}
  51. {$endif}
  52. {$ifdef VER135} // C++ Builder 5 ??
  53. {$define DELPHI_5}
  54. {$define DELPHI_4}
  55. {$define DELPHI_3}
  56. {$endif}
  57. {$ifdef VER140} // Delphi 6
  58. {$define DELPHI_6}
  59. {$define DELPHI_5}
  60. {$define DELPHI_4}
  61. {$define DELPHI_3}
  62. {$endif}
  63. {$ifdef VER145} // C++ Builder 6
  64. {$define DELPHI_6}
  65. {$define DELPHI_5}
  66. {$define DELPHI_4}
  67. {$define DELPHI_3}
  68. {$endif}
  69. {$ifdef VER150} // Delphi 7 :-) For once I am not late (12/07/2001)
  70. {$define DELPHI_7}
  71. {$define DELPHI_6}
  72. {$define DELPHI_5}
  73. {$define DELPHI_4}
  74. {$define DELPHI_3}
  75. {$endif}
  76. {$ifdef VER155} // C++ Builder 7
  77. {$define DELPHI_7}
  78. {$define DELPHI_6}
  79. {$define DELPHI_5}
  80. {$define DELPHI_4}
  81. {$define DELPHI_3}
  82. {$endif}
  83. //-------------------------------------------------------
  84. //--- Conclude supported features from delphi version ---
  85. //-------------------------------------------------------
  86. {$ifdef DELPHI_3}
  87. {$define SUPPORT_VARIANTS}
  88. {$ifdef DELPHI_4}
  89. {$define SUPPORT_DEFCHANGED}
  90. {$define SUPPORT_DEFAULT_PARAMS}
  91. {$define SUPPORT_NEW_TRANSLATE}
  92. {$define SUPPORT_INT64}
  93. {$define SUPPORT_REINTRODUCE}
  94. {$define SUPPORT_FIELDDEFS_UPDATED}
  95. {$define SUPPORT_FIELDDEF_ATTRIBUTES}
  96. {$define SUPPORT_FIELDDEF_TPERSISTENT}
  97. {$define SUPPORT_FIELDDEF_INDEX}
  98. {$define SUPPORT_FIELDTYPES_V4}
  99. {$define SUPPORT_UINT32_CARDINAL}
  100. {$ifdef DELPHI_5}
  101. {$define SUPPORT_BACKWARD_FIELDDATA}
  102. {$define SUPPORT_NEW_FIELDDATA}
  103. {$define SUPPORT_INITDEFSFROMFIELDS}
  104. {$define SUPPORT_DEF_DELETE}
  105. {$define SUPPORT_FREEANDNIL}
  106. {$ifdef DELPHI_6}
  107. {$define SUPPORT_PATHDELIM}
  108. {$endif}
  109. {$endif}
  110. {$endif}
  111. {$endif}
  112. //------------------------------------------------------
  113. //--- Conclude supported features in FreePascal ---
  114. //------------------------------------------------------
  115. {$ifdef FPC_VERSION}
  116. {$mode delphi}
  117. {$h+}
  118. {$ifndef CPUI386}
  119. {$undef USE_ASSEMBLER_486_UP}
  120. {$endif}
  121. {$ifndef FPC_LITTLE_ENDIAN}
  122. {$message error TDbf is not compatible with non little-endian CPUs. Please contact the author.}
  123. {$endif}
  124. {$ifdef USE_ASSEMBLER_486_UP}
  125. {$asmmode intel}
  126. {$endif}
  127. {$define SUPPORT_INT64}
  128. {$define SUPPORT_DEFAULT_PARAMS}
  129. {$define SUPPORT_NEW_TRANSLATE}
  130. {$define SUPPORT_NEW_FIELDDATA}
  131. {$define SUPPORT_FIELDDEF_TPERSISTENT}
  132. {$define SUPPORT_FIELDTYPES_V4}
  133. {$define SUPPORT_UINT32_CARDINAL}
  134. {$define SUPPORT_REINTRODUCE}
  135. // FPC 1.0.x exceptions: no 0/0 support
  136. {$ifdef VER1_0}
  137. {$undef NAN}
  138. {$undef SUPPORT_DEFAULT_PARAMS}
  139. {$undef SUPPORT_NEW_TRANSLATE}
  140. {$message error TDbf needs fpc 1.9 minimum.}
  141. {$endif}
  142. {$endif}
  143. //----------------------------------------------------------
  144. //--- Conclude supported features in non-Win32 platforms ---
  145. //----------------------------------------------------------
  146. {$ifndef WIN32}
  147. {$define SUPPORT_PATHDELIM}
  148. {$define SUPPORT_INCLUDETRAILPATHDELIM}
  149. {$define SUPPORT_INCLUDETRAILBACKSLASH}
  150. {$endif}