Debian Codegraph @

components/kascrypt/Hashes/Private/std.inc

raw
1 (*************************************************************************
2
3 DESCRIPTION : Standard definitions and options
4
5 REQUIREMENTS : TP5-7, D1-D7/D9-D12/D14-D24, FPC, VP, (TPW1.0/1.5,BCB3/4)
6
7 Version Date Author Modification
8 ------- -------- ------- ------------------------------------------
9 1.00 05.10.03 W.Ehrhardt Initial version
10 1.01 05.10.03 we X_OPT, removed TP4
11 1.02 30.10.03 we WINCRT
12 1.03 09.12.03 we {$R+,S+} {$ifdef debug}
13 1.04 26.12.03 we VP: {&Optimise+,SmartLink+,Speed+} ifndef debug
14 1.05 28.12.03 we DELPHI = Delphi32 (no Delphi 1!)
15 1.06 12.04.04 we Delphi 7
16 1.07 26.09.04 we Record starting values of important options
17 1.08 10.10.04 we RESULT for Result pseudo variable
18 1.09 02.01.05 we BIT16: default $F-
19 1.10 26.02.05 we StrictLong
20 1.11 05.05.05 we D9 aka Delphi 2005
21 1.12 22.05.05 we StrictLong for FPC 2.0
22 1.13 27.05.05 we {$goto on} for FPC
23 1.14 27.05.05 we moved {$goto on} to default settings
24 1.15 29.05.05 we HAS_INT64, HAS_MSG, _STD_INC_
25 1.16 06.08.05 we J_OPT, N_OPT, HAS_INLINE
26 1.17 17.08.05 we HAS_ASSERT
27 1.18 08.11.05 we APPCONS, partial TMT,TPW15 support
28 1.19 20.11.05 we Default option {$B-}
29 1.20 08.01.06 we ABSTRACT/DEFAULT
30 1.21 08.02.06 we Fix Scanhelp quirk
31 1.22 11.02.06 we VER5X
32 1.23 15.04.06 we HAS_XTYPES
33 1.24 08.05.06 we D10 aka Delphi 2006
34 1.25 25.05.06 we Define RESULT if FPC_OBJFPC is defined
35 1.26 08.09.06 we Define RESULT/DEFAULT if FPC_DELPHI is defined
36 1.27 14.11.06 we HAS_ASSERT for FPC VER1 and VER2
37 1.28 28.11.06 we HAS_UNSAFE, $warn SYMBOL_../UNSAFE_.. OFF
38 1.29 25.05.07 we D11 aka Delphi 2007, FPC2.1.4
39 1.30 23.06.07 we FPC_ProcVar: Helper for procedure variables
40 1.31 18.09.07 we HAS_INLINE for FPC VER2
41 1.32 04.10.07 we FPC Intel ASMmode only if CPUI386 is defined
42 1.33 22.11.07 we Record value of $X option, undef RESULT if $X-
43 1.34 19.05.08 we HAS_UINT64
44 1.35 21.06.08 we V7PLUS, HAS_UINT64 for FPC VER2_2
45 1.36 07.09.08 we HAS_CARD32
46 1.37 21.11.08 we D12 aka D2009
47 1.38 19.02.09 we TPW 1.0 adjustments
48 1.39 05.07.09 we D12Plus
49 1.40 17.10.09 we BASM (BASM16 or Bit32)
50 1.41 21.10.09 we HAS_OVERLOAD
51 1.42 07.04.10 we HAS_DENORM_LIT (Denormalised extended literals, e.g. -1.23e-4942)
52 1.43 20.06.10 we D14 (VER210)
53 1.45 16.10.10 we WIN16
54 1.46 05.11.10 we FPC VER2_4
55 1.47 12.11.11 we FPC VER2_6
56 1.48 01.01.12 we HAS_UINT64 for FPC VER2_6
57 1.49 12.01.12 we BIT64, WIN32or64, Bit32or64
58 1.50 13.01.12 we EXT64 (64 bit extended = double)
59 1.51 19.01.12 we Define EXT64 if SIMULATE_EXT64
60 1.52 05.09.12 we Basic support for D14, D15(XE), D16(XE2), D17(XE3)
61 1.53 01.12.12 we Simplified FPC 2.X.Y definitions
62 1.54 17.12.12 we UNIT_SCOPE (D16/D17)
63 1.55 25.12.12 we J_OPT for BIT64
64 1.56 25.04.13 we D18/XE4 (VER250)
65 1.57 28.09.13 we Basic support for D19/XE5 (VER260)
66 1.58 17.04.14 we Basic support for D20/XE6 (VER270)
67 1.59 06.05.14 we FPC/CPUARM: $define EXT64, i.e. no FP 80-bit extended
68 1.60 13.09.14 we Basic support for D21/XE7 (VER280)
69 1.61 22.10.14 we HAS_OUT
70 1.62 13.01.15 we FPC VER3 (FPC3.0.1/3.1.1), FPC2Plus, FPC271or3
71 1.63 22.04.15 we Basic support for D22/XE8 (VER290)
72 1.64 25.04.15 we HAS_INTXX, HAS_PINTXX
73 1.65 01.09.15 we Basic support for D23 (VER300) 'Seattle'
74 1.66 26.04.16 we Basic support for D24 (VER310) 'Berlin'
75 **************************************************************************)
76
77
78 (*-------------------------------------------------------------------------
79 (C) Copyright 2002-2016 Wolfgang Ehrhardt
80
81 This software is provided 'as-is', without any express or implied warranty.
82 In no event will the authors be held liable for any damages arising from
83 the use of this software.
84
85 Permission is granted to anyone to use this software for any purpose,
86 including commercial applications, and to alter it and redistribute it
87 freely, subject to the following restrictions:
88
89 1. The origin of this software must not be misrepresented; you must not
90 claim that you wrote the original software. If you use this software in
91 a product, an acknowledgment in the product documentation would be
92 appreciated but is not required.
93
94 2. Altered source versions must be plainly marked as such, and must not be
95 misrepresented as being the original software.
96
97 3. This notice may not be removed or altered from any source distribution.
98 ----------------------------------------------------------------------------*)
99
100 {$ifndef _STD_INC_}
101
102 {$define _STD_INC_} {include STD.INC only once}
103
104 {.$undef BIT16} {16 Bit code, Pascal / D1}
105 {.$undef BIT32} {32 Bit code}
106 {.$undef BIT64} {64 Bit code}
107 {.$undef DELPHI} {Delphi2+ and BCB++}
108 {.$undef G_OPT} {G+ option support}
109 {.$undef D4PLUS} {Delphi 4 or higher}
110 {.$undef BASM16} {16 Bit BASM}
111 {.$undef LoadArgs} {Register params}
112 {.$undef WINCRT} {Use WinCRT for console}
113 {.$undef WIN16} {Compiler for 16-bit windows}
114 {.$undef WIN32or64} {Compiler for 32/64-bit windows}
115 {.$undef RESULT} {Result pseudo variable}
116 {.$undef StrictLong} {Warning for longint const with MS bit}
117 {.$undef HAS_INT64} { int64 integer type available}
118 {.$undef HAS_UINT64} {uint64 integer type available}
119 {.$undef HAS_CARD32} {Has 32 bit cardinal}
120 {.$undef HAS_MSG} {Has message directive}
121 {.$undef HAS_INLINE} {Has inline procs/funcs (D9)}
122 {.$undef HAS_OUT} {Has OUT parameters: D3+, FPC2+ Delphi/ObjFPC}
123 {.$undef ABSTRACT} {Has abstract methods}
124 {.$undef DEFAULT} {Support default parameters}
125 {.$undef VER5X} {TP5 or TP55}
126 {.$undef HAS_XTYPES} {Xtra types in system: pByte, pLongint etc}
127 {.$undef HAS_UNSAFE} {UNSAFE warnings}
128 {.$undef APPCONS} {Needs "Apptype console" for console application}
129 {.$undef FPC_ProcVar} {FPC handling of @ and proc variables}
130 {.$undef FPC2Plus} {FPC 2 or newer}
131 {.$undef FPC271or3} {FPC 271 or 3 (less accurate for 64 bit or SSE2)}
132 {.$undef D12PLUS} {Delphi 12 or higher}
133 {.$undef HAS_OVERLOAD} {Overloading of procedures and functions}
134 {.$undef HAS_DENORM_LIT} {Denormalised (extended) literals, e.g. -1.23e-4942}
135 {.$undef EXT64} {64 bit extended = double}
136 {.$undef UNIT_SCOPE} {Unit scope name, D16+}
137 {.$undef HAS_INTXX} {Int8 .. Int32, UInt8 .. UInt32}
138 {.$undef HAS_PINTXX} {pInt8 .. pInt32, pUInt8 .. pUInt32}
139
140
141 {$define CONST} {const in proc declaration}
142 {$define Q_OPT} {Q- option support}
143 {$define X_OPT} {X+ option support}
144 {$define N_OPT} {N+ option support}
145 {$define BASM} {BASM16 or BIT32}
146 {$define V7PLUS} {TP7 or higher}
147
148
149 {$ifdef VER10} {TPW 1.0}
150 {$define BIT16}
151 {$define BASM16}
152 {$define WINCRT}
153 {$define G_OPT}
154 {$undef CONST}
155 {$undef Q_OPT}
156 {$undef V7PLUS}
157 {$endif}
158
159 {$ifdef VER15} {TPW 1.5}
160 {$define BIT16}
161 {$define BASM16}
162 {$define WINCRT}
163 {$define G_OPT}
164 {$undef CONST}
165 {$undef Q_OPT}
166 {$undef V7PLUS}
167 {$endif}
168
169 {$ifdef VER50 }
170 {$define BIT16}
171 {$define VER5X}
172 {$undef BASM}
173 {$undef CONST}
174 {$undef Q_OPT}
175 {$undef X_OPT}
176 {$undef V7PLUS}
177 {$endif}
178
179 {$ifdef VER55 }
180 {$define BIT16}
181 {$define VER5X}
182 {$undef BASM}
183 {$undef CONST}
184 {$undef Q_OPT}
185 {$undef X_OPT}
186 {$undef V7PLUS}
187 {$endif}
188
189 {$ifdef VER60 }
190 {$define BIT16}
191 {$undef CONST}
192 {$undef Q_OPT}
193 {$define G_OPT}
194 {$define BASM16}
195 {$undef V7PLUS}
196 {$endif}
197
198 {$ifdef VER70 }
199 {$define BIT16}
200 {$define G_OPT}
201 {$define BASM16}
202 {$endif}
203
204 {$ifdef VER80}
205 {.$define DELPHI} {D1} {*we V1.05}
206 {$define BIT16 }
207 {$define G_OPT }
208 {$define BASM16}
209 {$define WINCRT}
210 {$define RESULT}
211 {$endif}
212
213 {$ifdef VER90 }
214 {$define DELPHI} {D2}
215 {$endif}
216
217 {$ifdef VER93 }
218 {$define DELPHI} {BCB++1}
219 {$endif}
220
221 {$ifdef VER100}
222 {$define DELPHI} {D3}
223 {$define HAS_ASSERT}
224 {$define HAS_OUT}
225 {$endif}
226
227 {$ifdef VER110}
228 {$define DELPHI} {BCB3}
229 {$define HAS_OUT}
230 {$endif}
231
232 {$ifdef VER120}
233 {$define DELPHI} {D4}
234 {$define D4PLUS}
235 {$endif}
236
237 {$ifdef VER125}
238 {$define DELPHI} {BCB4}
239 {$define D4PLUS}
240 {$endif}
241
242 {$ifdef VER130}
243 {$define DELPHI} {D5}
244 {$define D4PLUS}
245 {$endif}
246
247 {$ifdef VER140}
248 {$define DELPHI} {D6}
249 {$define D4PLUS}
250 {$endif}
251
252 {$ifdef VER150}
253 {$define DELPHI} {D7}
254 {$define D4PLUS}
255 {$define HAS_UNSAFE}
256 {$define HAS_UINT64}
257 {$endif}
258
259 {$ifdef VER170}
260 {$define DELPHI} {D9}
261 {$define D4PLUS}
262 {$define HAS_INLINE}
263 {$define HAS_UNSAFE}
264 {$define HAS_UINT64}
265 {$endif}
266
267 {$ifdef VER180}
268 {$define DELPHI} {D10, D11 ifdef VER185}
269 {$define D4PLUS}
270 {$define HAS_INLINE}
271 {$define HAS_UNSAFE}
272 {$define HAS_UINT64}
273 {$endif}
274
275 {$ifdef VER200}
276 {$define DELPHI} {D12}
277 {$define D12PLUS}
278 {$endif}
279
280 {$ifdef VER210}
281 {$define DELPHI} {D14}
282 {$define D12PLUS}
283 {$endif}
284
285 {$ifdef VER220}
286 {$define DELPHI} {D15 - XE}
287 {$define D12PLUS}
288 {$endif}
289
290 {$ifdef VER230}
291 {$define DELPHI} {D16 - XE2}
292 {$define D12PLUS}
293 {$define UNIT_SCOPE}
294 {$endif}
295
296 {$ifdef VER240}
297 {$define DELPHI} {D17 - XE3}
298 {$define D12PLUS}
299 {$define UNIT_SCOPE}
300 {$endif}
301
302 {$ifdef VER250}
303 {$define DELPHI} {D18 - XE4}
304 {$define D12PLUS}
305 {$define UNIT_SCOPE}
306 {$endif}
307
308 {$ifdef VER260}
309 {$define DELPHI} {D19 - XE5}
310 {$define D12PLUS}
311 {$define UNIT_SCOPE}
312 {$endif}
313
314 {$ifdef VER270}
315 {$define DELPHI} {D20 - XE6}
316 {$define D12PLUS}
317 {$define UNIT_SCOPE}
318 {$endif}
319
320 {$ifdef VER280}
321 {$define DELPHI} {D21 - XE7}
322 {$define D12PLUS}
323 {$define UNIT_SCOPE}
324 {$endif}
325
326 {$ifdef VER290}
327 {$define DELPHI} {D22 - XE8}
328 {$define D12PLUS}
329 {$define UNIT_SCOPE}
330 {$endif}
331
332 {$ifdef VER300}
333 {$define DELPHI} {D23}
334 {$define D12PLUS}
335 {$define UNIT_SCOPE}
336 {$endif}
337
338 {$ifdef VER310}
339 {$define DELPHI} {D24}
340 {$define D12PLUS}
341 {$define UNIT_SCOPE}
342 {$endif}
343
344 {$ifdef CONDITIONALEXPRESSIONS} {D6+}
345 {$ifndef D4PLUS}
346 {$define D4PLUS}
347 {$endif}
348 {$define HAS_MSG}
349 {$define HAS_XTYPES}
350 {$ifdef CPUX64}
351 {$define BIT64}
352 {$endif}
353 {$endif}
354
355 {$ifdef VER70}
356 {$ifdef windows}
357 {$define WINCRT}
358 {$endif}
359 {$endif}
360
361 {$ifdef VirtualPascal}
362 {$define G_OPT}
363 {$define RESULT}
364 {$define LoadArgs}
365 {$endif}
366
367 {$ifdef WIN32}
368 {$define J_OPT}
369 {$endif}
370
371 {$ifdef BIT64}
372 {$define J_OPT}
373 {$endif}
374
375 {$ifdef FPC}
376 {$define FPC_ProcVar}
377 {$define ABSTRACT}
378 {$define HAS_XTYPES}
379 {$define HAS_OVERLOAD}
380 {$undef N_OPT}
381 {$ifdef VER1}
382 {$undef J_OPT}
383 {$define HAS_INT64}
384 {$define HAS_CARD32}
385 {$define HAS_MSG}
386 {$define HAS_ASSERT}
387 {$ifndef VER1_0}
388 {FPC 1.9.x}
389 {$define StrictLong}
390 {$else}
391 {$define LoadArgs}
392 {$endif}
393 {$endif}
394 {$ifdef VER2}
395 {$define FPC2Plus}
396 {$define HAS_ASSERT}
397 {$define HAS_INT64}
398 {$define HAS_CARD32}
399 {$define HAS_MSG}
400 {$define HAS_INLINE} {Remember to use -Si}
401 {$define StrictLong}
402 {$ifdef FPC_OBJFPC}
403 {$define DEFAULT}
404 {$endif}
405 {$ifdef FPC_DELPHI}
406 {$define DEFAULT}
407 {$endif}
408 {$ifndef VER2_0}
409 {$ifndef VER2_1}
410 {$define HAS_UINT64} {2.2+}
411 {$endif}
412 {$define HAS_DENORM_LIT} {2.1+}
413 {$endif}
414 {$ifdef VER2_7_1}
415 {$define FPC271or3}
416 {$endif}
417 {$ifdef VER2_6_2}
418 {$define HAS_INTXX}
419 {$endif}
420 {$ifdef VER2_6_4}
421 {$define HAS_INTXX}
422 {$define HAS_PINTXX}
423 {$endif}
424 {$endif}
425 {$ifdef VER3}
426 {$define FPC2Plus}
427 {$define FPC271or3}
428 {$define HAS_ASSERT}
429 {$define HAS_INT64}
430 {$define HAS_CARD32}
431 {$define HAS_MSG}
432 {$define HAS_INLINE}
433 {$define HAS_UINT64}
434 {$define HAS_DENORM_LIT}
435 {$define StrictLong}
436 {$define HAS_INTXX}
437 {$define HAS_PINTXX}
438 {$ifdef FPC_OBJFPC}
439 {$define DEFAULT}
440 {$endif}
441 {$ifdef FPC_DELPHI}
442 {$define DEFAULT}
443 {$endif}
444 {$endif}
445
446 {Note: Mode detection does not work for -Sxxx and version < 2.0.2}
447 {$ifdef FPC_OBJFPC}
448 {$define RESULT}
449 {$define HAS_OUT}
450 {$endif}
451 {$ifdef FPC_DELPHI}
452 {$define RESULT}
453 {$define HAS_OUT}
454 {$undef FPC_ProcVar}
455 {$endif}
456 {$ifdef FPC_TP}
457 {$undef FPC_ProcVar}
458 {$endif}
459 {$ifdef FPC_GPC}
460 {$undef FPC_ProcVar}
461 {$endif}
462 {$ifdef CPU64}
463 {$define BIT64}
464 {$endif}
465 {$ifdef CPUARM}
466 {$define EXT64} {No extended for ARM}
467 {$endif}
468 {$endif}
469
470 {$ifdef __TMT__}
471 {$undef N_OPT}
472 {$define RESULT}
473 {$define HAS_INT64}
474 {$define LoadArgs}
475 {$ifdef __WIN32__}
476 {$define WIN32}
477 {$endif}
478 {$endif}
479
480 {$ifndef BIT16}
481 {$define Bit32or64}
482 {$ifndef BIT64}
483 {$define BIT32}
484 {$endif}
485 {$endif}
486
487 {$ifdef BIT16}
488 {$ifdef WINDOWS}
489 {$define WIN16}
490 {$endif}
491 {$endif}
492
493 {$ifdef Delphi}
494 {$define RESULT}
495 {$define ABSTRACT}
496 {$define HAS_DENORM_LIT}
497 {$endif}
498
499 {$ifdef D12Plus}
500 {$ifndef D4PLUS}
501 {$define D4PLUS}
502 {$endif}
503 {$define HAS_INLINE}
504 {$define HAS_UNSAFE}
505 {$define HAS_UINT64}
506 {$define HAS_INTXX}
507 {$endif}
508
509 {$ifdef D4Plus}
510 {$define HAS_OUT}
511 {$define HAS_INT64}
512 {$define HAS_CARD32}
513 {$define StrictLong}
514 {$define HAS_ASSERT}
515 {$define DEFAULT}
516 {$define HAS_OVERLOAD}
517 {$endif}
518
519 {$ifdef WIN32}
520 {$define WIN32or64}
521 {$ifndef VirtualPascal}
522 {$define APPCONS}
523 {$endif}
524 {$endif}
525
526 {$ifdef WIN64}
527 {$define BIT64}
528 {$define WIN32or64}
529 {$define EXT64}
530 {$define APPCONS}
531 {$endif}
532
533 {$ifdef BIT64}
534 {$undef BASM}
535 {$endif}
536
537
538 {-- Default options --}
539
540 {$ifndef FPC}
541 {$B-} {short-circuit boolean expression evaluation, FPC has always B-!}
542 {$endif}
543
544 {$ifdef FPC}
545 {$ifdef CPUI386}
546 {$ASMmode intel}
547 {$endif}
548 {$goto on}
549 {$endif}
550
551 {$ifdef VirtualPascal}
552 {$ifndef debug}
553 {&Optimise+,SmartLink+,Speed+}
554 {$endif}
555 {$endif}
556
557 {$ifdef G_OPT}
558 {$G+}
559 {$endif}
560
561 {$ifdef Q_OPT}
562 {Most Crypto and CRC/Hash units need Q-, define Q+ locally if needed}
563 {$Q-}
564 {$endif}
565
566 {$ifdef debug}
567 {$R+,S+} {Note: D9+ needs $R- for StrictLong setting!}
568 {$else}
569 {$R-,S-}
570 {$endif}
571
572 {$ifdef SIMULATE_EXT64}
573 {$define EXT64}
574 {$endif}
575
576 {$ifdef BIT16}
577 {$F-}
578 {$endif}
579
580 {-- Record the starting values of important local options --}
581 {$ifopt A+} {$define Align_on} {$endif}
582 {$ifopt B+} {$define BoolEval_on} {$endif}
583 {$ifopt D+} {$define DebugInfo_on} {$endif}
584 {$ifopt I+} {$define IOChecks_on} {$endif}
585 {$ifopt R+} {$define RangeChecks_on} {$endif}
586 {$ifopt V+} {$define VarStringChecks_on} {$endif}
587
588
589 {$ifdef Q_OPT}
590 {$ifopt P+} {$define OpenStrings_on} {$endif}
591 {$ifopt Q+} {$define OverflowChecks_on} {$endif}
592 {$endif}
593
594 {-- Note that X option is GLOBAL --}
595 {$ifdef X_OPT}
596 {$ifopt X+} {$define ExtendedSyntax_on} {$endif}
597 {$ifopt X-} {$undef RESULT} {$endif}
598 {$endif}
599
600 {$ifdef CONDITIONALEXPRESSIONS}
601 {$warn SYMBOL_PLATFORM OFF}
602 {$warn SYMBOL_DEPRECATED OFF}
603 {$warn SYMBOL_LIBRARY OFF}
604 {$warn UNIT_DEPRECATED OFF}
605 {$warn UNIT_LIBRARY OFF}
606 {$warn UNIT_PLATFORM OFF}
607 {$ifdef HAS_UNSAFE}
608 {$warn UNSAFE_TYPE OFF}
609 {$warn UNSAFE_CODE OFF}
610 {$warn UNSAFE_CAST OFF}
611 {$endif}
612 {$endif}
613
614 {$else}
615
616 {$ifdef HAS_MSG}
617 {$message 'std.inc included more than once'}
618 {$endif}
619
620 {$endif}
621