ivarol128.pp 829 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. {$ifndef bigfile}
  2. {$ifdef fpc}
  3. {$mode delphi}
  4. {$else fpc}
  5. {$define FPC_HAS_TYPE_EXTENDED}
  6. {$endif fpc}
  7. {$endif bigfile}
  8. type
  9. {$ifdef FPC_COMP_IS_INT64}
  10. comp128 = double;
  11. {$else FPC_COMP_IS_INT64}
  12. comp128 = comp;
  13. {$endif FPC_COMP_IS_INT64}
  14. procedure test128(a: shortint); overload;
  15. begin
  16. writeln('shortint called instead of ansistring');
  17. end;
  18. procedure test128(a: ansistring); overload;
  19. begin
  20. writeln('ansistring called instead of shortint');
  21. halt(1)
  22. end;
  23. var
  24. x128: shortint;
  25. y128: ansistring;
  26. procedure dotest128;
  27. var
  28. v: variant;
  29. begin
  30. try
  31. v := x128;
  32. test128(v);
  33. except
  34. on E : TObject do
  35. halt(1);
  36. end;
  37. try
  38. v := y128;
  39. test128(v);
  40. except
  41. on E : TObject do
  42. writeln('VVV');
  43. end;
  44. end;
  45. {$ifndef bigfile} begin
  46. dotest128;
  47. end. {$endif not bigfile}