macpas.pp 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. {
  2. This file is part of the Free Pascal Run time library.
  3. Copyright (c) 2004 by Olle Raab
  4. This unit contain procedures specific for mode MacPas.
  5. It should be platform independant.
  6. See the file COPYING.FPC, included in this distribution,
  7. For details about the copyright.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  11. **********************************************************************}
  12. unit MacPas;
  13. interface
  14. { Using inlining for small system functions/wrappers }
  15. {$ifdef HASINLINE}
  16. {$inline on}
  17. {$define SYSTEMINLINE}
  18. {$endif}
  19. type
  20. LongDouble = ValReal;
  21. {FourCharCode coercion
  22. This routine coreces string literals to a FourCharCode.}
  23. function FCC(literal: string): LongWord; {$ifdef systeminline}inline;{$endif}
  24. {Same as FCC, to be compatible with GPC}
  25. function FOUR_CHAR_CODE(literal: string): LongWord; {$ifdef systeminline}inline;{$endif}
  26. {This makes casts from ShortString to FourCharCode automatically,
  27. to emulate the behaviour of mac pascal compilers}
  28. operator := (s: ShortString) res: LongWord; {$ifdef systeminline}inline;{$endif}
  29. implementation
  30. function FCC(literal: string): LongWord; {$ifdef systeminline}inline;{$endif}
  31. begin
  32. FCC := PLongWord(@literal[1])^;
  33. end;
  34. function FOUR_CHAR_CODE(literal: string): LongWord; {$ifdef systeminline}inline;{$endif}
  35. begin
  36. FOUR_CHAR_CODE := PLongWord(@literal[1])^;
  37. end;
  38. operator := (s: ShortString) res: LongWord; {$ifdef systeminline}inline;{$endif}
  39. begin
  40. res := PLongWord(@s[1])^;
  41. end;
  42. end.