ImagingOptions.inc 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  1. {
  2. User Options
  3. Following defines and options can be changed by user.
  4. }
  5. { Source options }
  6. {$DEFINE USE_INLINE} // Use function inlining for some functions
  7. // works in Free Pascal and Delphi 9+.
  8. {$DEFINE USE_ASM} // If defined, assembler versions of some
  9. // functions will be used (only for x86).
  10. // Debug options: If none of these two are defined
  11. // your project settings are used.
  12. {.$DEFINE IMAGING_DEBUG} // If defined, debug info, range/IO/overflow
  13. // checking, stack frames, assertions, and
  14. // other debugging options will be turned on.
  15. {.$DEFINE IMAGING_RELEASE} // If defined, all debug info is off.
  16. (* File format support linking options.
  17. Define formats which you don't want to be registered automatically (by adding
  18. Imaging.pas unit to your uses clause).
  19. Default: most formats are registered = no symbols defined.
  20. Example: If you want to disable JPEG support just uncomment //{$DEFINE DONT_LINK_JPEG} line
  21. *)
  22. {.$DEFINE DONT_LINK_JPEG} // link support for Jpeg images
  23. {.$DEFINE DONT_LINK_PNG} // link support for PNG images
  24. {.$DEFINE DONT_LINK_TARGA} // link support for Targa images
  25. {.$DEFINE DONT_LINK_BITMAP} // link support for Windows Bitmap images
  26. {.$DEFINE DONT_LINK_DDS} // link support for DDS images
  27. {.$DEFINE DONT_LINK_GIF} // link support for GIF images
  28. {.$DEFINE DONT_LINK_MNG} // link support for MNG images
  29. {.$DEFINE DONT_LINK_JNG} // link support for JNG images
  30. {.$DEFINE DONT_LINK_PNM} // link support for PortableMap images (PBM, PGM, PPM, PAM, PFM)
  31. {.$DEFINE DONT_LINK_RADHDR} // link support for Radiance HDR/RGBE file format
  32. {.$DEFINE DONT_LINK_QOI} // link support for Quite OK Image Format
  33. {.$DEFINE DONT_LINK_EXTRAS} // link support for file formats defined in
  34. // Extensions package. Exactly which formats will be
  35. // registered depends on settings in
  36. // ImagingExtFileFormats.pas unit.
  37. {.$DEFINE DONT_LINK_FILE_FORMATS} // no auto link support of any file format
  38. {
  39. Auto Options
  40. Following options and defines are set automatically and some
  41. are required for Imaging to compile successfully. Do not change
  42. anything here if you don't know what you are doing.
  43. }
  44. { Compiler options }
  45. {$ALIGN ON} // Field alignment: 8 Bytes (in D6+)
  46. {$BOOLEVAL OFF} // Boolean eval: off
  47. {$EXTENDEDSYNTAX ON} // Extended syntax: on
  48. {$LONGSTRINGS ON} // string = AnsiString: on
  49. {$MINENUMSIZE 1} // Min enum size: 1 B
  50. {$TYPEDADDRESS OFF} // Typed pointers: off
  51. {$WRITEABLECONST OFF} // Writeable constants: off
  52. {$IFNDEF FPC}
  53. {$DEFINE DCC} // if not using FPC then DCC compiler is used (Delphi/BCB)
  54. // others are not supported
  55. {$ENDIF}
  56. {$IFDEF DCC}
  57. {$DEFINE DELPHI}
  58. {$IF (Defined(DCC) and (CompilerVersion >= 25.0))}
  59. {$LEGACYIFEND ON}
  60. {$IFEND}
  61. {$ENDIF}
  62. {$IF (Defined(DCC) and (CompilerVersion >= 18.5))}
  63. {$IFDEF RELEASE}
  64. {$UNDEF DEBUG} // If we are using Delphi 2007+ where you can set
  65. // DEBUG/RELEASE mode in project options and RELEASE
  66. // is currently set we undef DEBUG mode
  67. {$ENDIF}
  68. {$IFEND}
  69. {$IFDEF DEBUG}
  70. {$DEFINE IMAGING_DEBUG}
  71. {$ENDIF}
  72. {$IF Defined(IMAGING_DEBUG)}
  73. {$ASSERTIONS ON}
  74. {$DEBUGINFO ON}
  75. {$RANGECHECKS ON}
  76. {$IOCHECKS ON}
  77. {$OVERFLOWCHECKS ON}
  78. {$IFDEF DCC}
  79. {$OPTIMIZATION OFF}
  80. {$STACKFRAMES ON}
  81. {$LOCALSYMBOLS ON}
  82. {$DEFINE MEMCHECK}
  83. {$ENDIF}
  84. {$IFDEF FPC}
  85. {$S+}
  86. {$CHECKPOINTER ON}
  87. {$ENDIF}
  88. {$ELSEIF Defined(IMAGING_RELEASE)}
  89. {$ASSERTIONS OFF}
  90. {$DEBUGINFO OFF}
  91. {$RANGECHECKS OFF}
  92. {$IOCHECKS OFF}
  93. {$OVERFLOWCHECKS OFF}
  94. {$IFDEF DCC}
  95. {$OPTIMIZATION ON}
  96. {$STACKFRAMES OFF}
  97. {$LOCALSYMBOLS OFF}
  98. {$ENDIF}
  99. {$IFDEF FPC}
  100. {$S-}
  101. {$ENDIF}
  102. {$IFEND}
  103. {$IF Defined(CPU86) and not Defined(CPUX86)}
  104. {$DEFINE CPUX86} // Compatibility with Delphi
  105. {$IFEND}
  106. {$IF Defined(CPUX86_64) and not Defined(CPUX64)}
  107. {$DEFINE CPUX64} // Compatibility with Delphi
  108. {$IFEND}
  109. {$IF Defined(DARWIN) and not Defined(MACOS)}
  110. {$DEFINE MACOS} // Compatibility with Delphi
  111. {$IFEND}
  112. {$IF Defined(MACOS)}
  113. {$DEFINE MACOSX}
  114. {$IFEND}
  115. {$IF Defined(DCC) and (CompilerVersion < 23)} // < XE2
  116. {$DEFINE CPUX86} // Compatibility with older Delphi
  117. {$IFEND}
  118. {$IF Defined(WIN32) or Defined(WIN64)}
  119. {$DEFINE MSWINDOWS} // Compatibility with Delphi
  120. {$IFEND}
  121. {$IF Defined(UNIX) and not Defined(POSIX)}
  122. {$DEFINE POSIX} // Compatibility with Delphi
  123. {$IFEND}
  124. { Compiler capabilities }
  125. // Define if compiler supports inlining of functions and procedures
  126. {$IF (Defined(DCC) and (CompilerVersion >= 17)) or Defined(FPC)}
  127. {$DEFINE HAS_INLINE}
  128. {$IFEND}
  129. // Define if compiler supports advanced records with methods
  130. {$IF (Defined(DCC) and (CompilerVersion >= 18)) or
  131. (Defined(FPC) and (FPC_FULLVERSION >= 20600))}
  132. {$DEFINE HAS_ADVANCED_RECORDS}
  133. {$IFEND}
  134. // Define if compiler supports operator overloading
  135. // (unfortunately Delphi and FPC operator overloading is not compatible).
  136. // FPC supports Delphi compatible operator overloads since 2.6.0
  137. {$IF (Defined(DCC) and (CompilerVersion >= 18)) or
  138. (Defined(FPC) and (FPC_FULLVERSION >= 20600))}
  139. {$DEFINE HAS_OPERATOR_OVERLOADING}
  140. {$IFEND}
  141. // Anonymous methods
  142. {$IF Defined(DCC) and (CompilerVersion >= 20) }
  143. {$DEFINE HAS_ANON_METHODS}
  144. {$IFEND}
  145. // Generic types (Delphi and FPC implementations incompatible).
  146. // Update: FPC supports Delphi compatible generics since 2.6.0
  147. {$IF (Defined(DCC) and (CompilerVersion >= 20)) or
  148. (Defined(FPC) and (FPC_FULLVERSION >= 20600))}
  149. {$DEFINE HAS_GENERICS}
  150. {$IFEND}
  151. { Compiler pecularities }
  152. // Delphi 64bit POSIX targets
  153. {$IF Defined(DCC) and (SizeOf(Integer) <> SizeOf(LongInt))}
  154. {$DEFINE LONGINT_IS_NOT_INTEGER}
  155. {$IFEND}
  156. // They used to force IFEND, now they warn about it
  157. {$IF Defined(DCC) and (CompilerVersion >= 33)}
  158. {$LEGACYIFEND ON}
  159. {$IFEND}
  160. { Imaging options check}
  161. {$IFNDEF HAS_INLINE}
  162. {$UNDEF USE_INLINE}
  163. {$ENDIF}
  164. {$IF not Defined(CPUX86)}
  165. {$UNDEF USE_ASM}
  166. {$IFEND}
  167. {$IFDEF FPC}
  168. {$DEFINE COMPONENT_SET_LCL}
  169. {$UNDEF COMPONENT_SET_VCL}
  170. {$ENDIF}
  171. {$IFDEF DELPHI}
  172. {$UNDEF COMPONENT_SET_LCL}
  173. {$DEFINE COMPONENT_SET_VCL}
  174. {$ENDIF}
  175. { More compiler options }
  176. {$IFDEF FPC} // Free Pascal options - some options set above (like min enum size)
  177. // are reset to defaults by setting {$MODE} so they are
  178. // redeclared here
  179. {$MODE DELPHI} // compatible with delphi
  180. {$GOTO ON} // alow goto
  181. {$PACKRECORDS 8} // same as ALING 8 for Delphi
  182. {$PACKENUM 4} // Min enum size: 4 B
  183. {$IFDEF CPU86}
  184. {$ASMMODE INTEL} // intel assembler mode
  185. {$ENDIF}
  186. {$ENDIF}
  187. {$IFDEF HAS_INLINE}
  188. {$INLINE ON} // turns inlining on for compilers that support it
  189. {$ENDIF}