setjumph.inc 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. {
  2. $Id$
  3. This file is part of the Free Pascal run time library.
  4. Copyright (c) 1998 the Free Pascal development team
  5. SetJmp/Longjmp declarations
  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. {$ifndef VER1_0}
  13. {$if (FPC_VERSION>1) or ((FPC_RELEASE>=9) and (FPC_PATCH>6))}
  14. {$ifdef linux}
  15. {$define needsigprocmask}
  16. {$endif}
  17. {$endif}
  18. {$endif}
  19. {$ifdef needsigprocmask}
  20. const
  21. {$ifdef FPC_USE_LIBC}
  22. jmpbufsigmaskwords = 1024 div 32;
  23. {$else}
  24. jmpbufsigmaskwords = 128 div 32;
  25. {$endif}
  26. type
  27. tjmpsigset=array[0..jmpbufsigmaskwords-1] of longint;
  28. pjmpsigset=^tjmpsigset;
  29. {$endif needsigprocmask}
  30. Type
  31. jmp_buf = packed record
  32. ebx,esi,edi : Longint;
  33. bp,sp,pc : Pointer;
  34. {$ifdef needsigprocmask}
  35. sigmask : tjmpsigset;
  36. {$endif needsigprocmask}
  37. end;
  38. PJmp_buf = ^jmp_buf;
  39. Function Setjmp (Var S : Jmp_buf) : longint;
  40. Procedure longjmp (Var S : Jmp_buf; value : longint);
  41. {
  42. $Log$
  43. Revision 1.6 2005-01-24 16:54:16 peter
  44. * no sigprocmask for 1.0.x bootstrapping
  45. Revision 1.5 2005/01/20 16:38:28 peter
  46. * restore sigprocmask for linux
  47. Revision 1.4 2002/09/15 10:04:31 carl
  48. * make the record packed (just in case)
  49. Revision 1.3 2002/09/07 16:01:19 peter
  50. * old logs removed and tabs fixed
  51. }