root / Imaging / ImagingOptions.inc @ 0:95bd93c28625
History | View | Annotate | Download (7.1 kB)
| 1 | { $Id: ImagingOptions.inc 100 2007-06-28 21:09:52Z galfar $ }
|
|---|---|
| 2 | |
| 3 | {
|
| 4 | User Options |
| 5 | Following defines and options can be changed by user. |
| 6 | } |
| 7 | |
| 8 | { Source options. }
|
| 9 | |
| 10 | {$DEFINE USE_INLINE} // use function inlining for some functions
|
| 11 | // works in Free Pascal and Delphi 9+ |
| 12 | {$DEFINE USE_ASM} // if defined, assembler versions of some
|
| 13 | // functions will be used (only for x86) |
| 14 | { $DEFINE DEBUG} // if defined, debug info, range/IO/overflow
|
| 15 | // checking, stack frames, assertions, and |
| 16 | // other debugging options will be turned on |
| 17 | |
| 18 | { File format support linking options. Undefine formats which you don't want
|
| 19 | to be registred automatically. } |
| 20 | |
| 21 | {.$DEFINE LINK_JPEG} // link support for Jpeg images
|
| 22 | {.$DEFINE LINK_PNG} // link support for PNG images
|
| 23 | {$DEFINE LINK_TARGA} // link support for Targa images
|
| 24 | {$DEFINE LINK_BITMAP} // link support for Windows Bitmap images
|
| 25 | {.$DEFINE LINK_DDS} // link support for DDS images
|
| 26 | {.$DEFINE LINK_GIF} // link support for GIF images
|
| 27 | {.$DEFINE LINK_MNG} // link support for MNG images
|
| 28 | {.$DEFINE LINK_JNG} // link support for JNG images
|
| 29 | {.$DEFINE LINK_PNM} // link support for PortableMap images (PBM, PGM, PPM, PAM, PFM)
|
| 30 | |
| 31 | {.$DEFINE LINK_EXTRAS} // link support for file formats defined in
|
| 32 | // Extras package. Exactly which formats will be |
| 33 | // registered depends on settings in |
| 34 | // ImagingExtras.pas unit. |
| 35 | |
| 36 | { Component set used in ImagignComponents.pas unit. You usually don't need
|
| 37 | to be concerned with this - proper component library is selected automatically |
| 38 | according to your compiler (only exception is using CLX in Delphi 6/7). } |
| 39 | |
| 40 | {$DEFINE COMPONENT_SET_VCL} // use Borland's VCL
|
| 41 | { $DEFINE COMPONENT_SET_CLX} // use Borland's CLX (set automatically when using Kylix,
|
| 42 | // must be se manually when compiling with Delphi 6/7) |
| 43 | { $DEFINE COMPONENT_SET_LCL} // use Lazarus' LCL (set automatically when
|
| 44 | // compiling with FPC) |
| 45 | |
| 46 | {
|
| 47 | Auto Options |
| 48 | Following options and defines are set automatically and some |
| 49 | are required for Imaging to compile successfully. Do not change |
| 50 | anything here if you don't know what you are doing. |
| 51 | } |
| 52 | |
| 53 | { Compiler options }
|
| 54 | |
| 55 | {$ALIGN ON} // Field alignment: 8 Bytes (in D6+)
|
| 56 | {$BOOLEVAL OFF} // Boolean eval: off
|
| 57 | {$EXTENDEDSYNTAX ON} // Extended syntax: on
|
| 58 | {$LONGSTRINGS ON} // string = AnsiString: on
|
| 59 | {$MINENUMSIZE 4} // Min enum size: 4 B
|
| 60 | {$TYPEDADDRESS OFF} // Typed pointers: off
|
| 61 | {$WRITEABLECONST OFF} // Writeable constants: off
|
| 62 | |
| 63 | {$IFNDEF FPC}
|
| 64 | {$DEFINE DCC} // if not using FPC then DCC compiler is used (Delphi/Kylix)
|
| 65 | // others are not supported |
| 66 | {$ENDIF}
|
| 67 | |
| 68 | {$IFDEF DCC}
|
| 69 | {$IFDEF LINUX}
|
| 70 | {$DEFINE KYLIX} // using Kylix
|
| 71 | {$ENDIF}
|
| 72 | {$ENDIF}
|
| 73 | |
| 74 | {$IFDEF DCC}
|
| 75 | {$IFNDEF KYLIX}
|
| 76 | {$DEFINE DELPHI} // using Delphi
|
| 77 | {$ENDIF}
|
| 78 | {$ENDIF}
|
| 79 | |
| 80 | {$IF (Defined(DCC) and (CompilerVersion >= 18.5))}
|
| 81 | {$IFDEF RELEASE}
|
| 82 | {$UNDEF DEBUG} // If we are using Delphi 2007+ where you can set
|
| 83 | // DEBUG/RELEASE mode in project options and RELEASE |
| 84 | // is currently set we undef DEBUG mode |
| 85 | {$ENDIF}
|
| 86 | {$IFEND}
|
| 87 | |
| 88 | {$IFDEF DEBUG}
|
| 89 | {$ASSERTIONS ON}
|
| 90 | {$DEBUGINFO ON}
|
| 91 | {$RANGECHECKS ON}
|
| 92 | {$IOCHECKS ON}
|
| 93 | {$OVERFLOWCHECKS ON}
|
| 94 | {$IFDEF DCC}
|
| 95 | {$OPTIMIZATION OFF}
|
| 96 | {$STACKFRAMES ON}
|
| 97 | {$LOCALSYMBOLS ON}
|
| 98 | { $DEFINE MEMCHECK}
|
| 99 | {$ENDIF}
|
| 100 | {$IFDEF FPC}
|
| 101 | {$S+}
|
| 102 | {$CHECKPOINTER ON}
|
| 103 | {$ENDIF}
|
| 104 | {$ELSE}
|
| 105 | {$ASSERTIONS OFF}
|
| 106 | {$DEBUGINFO OFF}
|
| 107 | {$RANGECHECKS OFF}
|
| 108 | {$IOCHECKS OFF}
|
| 109 | {$OVERFLOWCHECKS OFF}
|
| 110 | {$IFDEF DCC}
|
| 111 | {$OPTIMIZATION ON}
|
| 112 | {$STACKFRAMES OFF}
|
| 113 | {$LOCALSYMBOLS OFF}
|
| 114 | {$ENDIF}
|
| 115 | {$IFDEF FPC}
|
| 116 | {$S-}
|
| 117 | {$ENDIF}
|
| 118 | {$ENDIF}
|
| 119 | |
| 120 | { Compiler capabilities }
|
| 121 | |
| 122 | // Define if compiler supports inlining of functions and procedures |
| 123 | // Note that FPC inline support crashed in older versions (1.9.8) |
| 124 | {$IF (Defined(DCC) and (CompilerVersion >= 17)) or (Defined(FPC) and Defined(CPU86))}
|
| 125 | {$DEFINE HAS_INLINE}
|
| 126 | {$IFEND}
|
| 127 | |
| 128 | // Define if compiler supports advanced records with methods |
| 129 | {$IF (Defined(DCC) and (CompilerVersion >= 18)) }
|
| 130 | {$DEFINE HAS_ADVANCED_RECORDS}
|
| 131 | {$IFEND}
|
| 132 | |
| 133 | // Define if compiler supports operator overloading |
| 134 | // (unfortunately Delphi and FPC operator overloaing is not compatible) |
| 135 | {$IF (Defined(DCC) and (CompilerVersion >= 18)) or Defined(FPC)}
|
| 136 | {$DEFINE HAS_OPERATOR_OVERLOADING}
|
| 137 | {$IFEND}
|
| 138 | |
| 139 | { Imaging options check}
|
| 140 | |
| 141 | {$IFNDEF HAS_INLINE}
|
| 142 | {$UNDEF USE_INLINE}
|
| 143 | {$ENDIF}
|
| 144 | |
| 145 | {$IFDEF FPC}
|
| 146 | {$IFNDEF CPU86}
|
| 147 | {$UNDEF USE_ASM}
|
| 148 | {$ENDIF}
|
| 149 | {$ENDIF}
|
| 150 | |
| 151 | {$IFDEF FPC}
|
| 152 | {$DEFINE COMPONENT_SET_LCL}
|
| 153 | {$UNDEF COMPONENT_SET_VCL}
|
| 154 | {$UNDEF COMPONENT_SET_CLX}
|
| 155 | {$ENDIF}
|
| 156 | |
| 157 | {$IFDEF KYLIX}
|
| 158 | {$DEFINE COMPONENT_SET_CLX}
|
| 159 | {$UNDEF COMPONENT_SET_VCL}
|
| 160 | {$UNDEF COMPONENT_SET_LCL}
|
| 161 | {$ENDIF}
|
| 162 | |
| 163 | {$IFDEF DELPHI}
|
| 164 | {$UNDEF COMPONENT_SET_LCL}
|
| 165 | {$IF CompilerVersion >= 17}
|
| 166 | {$UNDEF COMPONENT_SET_CLX} // Delphi 9+ has no CLX
|
| 167 | {$IFEND}
|
| 168 | {$IFNDEF COMPONENT_SET_VCL}
|
| 169 | {$IFNDEF COMPONENT_SET_CLX}
|
| 170 | {$DEFINE COMPONENT_SET_VCL} // use VCL as default if not set
|
| 171 | {$ENDIF}
|
| 172 | {$ENDIF}
|
| 173 | {$ENDIF}
|
| 174 | |
| 175 | {$IFDEF COMPONENT_SET_VCL}
|
| 176 | {$UNDEF COMPONENT_SET_CLX}
|
| 177 | {$UNDEF COMPONENT_SET_LCL}
|
| 178 | {$ENDIF}
|
| 179 | |
| 180 | {$IFDEF COMPONENT_SET_CLX}
|
| 181 | {$UNDEF COMPONENT_SET_VCL}
|
| 182 | {$UNDEF COMPONENT_SET_LCL}
|
| 183 | {$ENDIF}
|
| 184 | |
| 185 | {$IFDEF COMPONENT_SET_LCL}
|
| 186 | {$UNDEF COMPONENT_SET_VCL}
|
| 187 | {$UNDEF COMPONENT_SET_CLX}
|
| 188 | {$ENDIF}
|
| 189 | |
| 190 | { Platform options }
|
| 191 | |
| 192 | {$IFDEF WIN32}
|
| 193 | {$DEFINE MSWINDOWS}
|
| 194 | {$ENDIF}
|
| 195 | |
| 196 | {$IFDEF DPMI}
|
| 197 | {$DEFINE MSDOS}
|
| 198 | {$ENDIF}
|
| 199 | |
| 200 | {$IFDEF LINUX}
|
| 201 | {$DEFINE UNIX}
|
| 202 | {$ENDIF}
|
| 203 | |
| 204 | { More compiler options }
|
| 205 | |
| 206 | {$IFDEF FPC} // Free Pascal options - some options set above (like min enum size)
|
| 207 | // are reset to defaults by setting {$MODE} so they are
|
| 208 | // redeclared here |
| 209 | {$MODE DELPHI} // compatible with delphi
|
| 210 | {$GOTO ON} // alow goto
|
| 211 | {$PACKRECORDS 8} // same as ALING 8 for Delphi
|
| 212 | {$PACKENUM 4} // Min enum size: 4 B
|
| 213 | {$CALLING REGISTER} // default calling convention is register
|
| 214 | {$IFDEF CPU86}
|
| 215 | {$IFNDEF DYN_LIBRARY}
|
| 216 | {$SMARTLINK ON} // smartlinking on, but not for dll/so -
|
| 217 | // nothing gets exported from library when it is on |
| 218 | // in FPC 1.9.8 |
| 219 | {$ENDIF}
|
| 220 | {$ASMMODE INTEL} // intel assembler mode
|
| 221 | {$ENDIF}
|
| 222 | {$ENDIF}
|
| 223 | |
| 224 | {$IFDEF HAS_INLINE}
|
| 225 | {$INLINE ON} // turns inlining on for compilers that support it
|
| 226 | {$ENDIF}
|
| 227 | |
| 228 | { Extension dependencies check }
|
| 229 | |
| 230 | {$IFDEF LINK_MNG} // MNG uses internaly both PNG and JNG
|
| 231 | {$DEFINE LINK_JNG}
|
| 232 | {$DEFINE LINK_PNG}
|
| 233 | {$ENDIF}
|
| 234 | |
| 235 | {$IFDEF LINK_JNG} // JNG uses internaly both PNG and JPEG
|
| 236 | {$DEFINE LINK_PNG}
|
| 237 | {$DEFINE LINK_JPEG}
|
| 238 | {$ENDIF}
|
| 239 | |
| 240 |