scheme48vm-prelude.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #include <stdlib.h>
  2. #include <stdio.h>
  3. #include <string.h> /* memcpy, strlen */
  4. #include "c-mods.h"
  5. #include "scheme48write-barrier.h"
  6. /*
  7. * This is to tell the C compiler that the result may be negative even
  8. * though the operands are unsigned. It is still dubious: A cast from
  9. * an unsigned to an int that involves an overflow pretty much has
  10. * undefined result - the C standard does not give us two's complement
  11. * arithmetic.
  12. */
  13. #define SMALL_MULTIPLY(x,y) ((long)((unsigned long)(x) * (unsigned long)(y)))
  14. #define NO_ERRORS 0 /* extension to errno.h */
  15. #include "scheme48vm.h"
  16. #include "scheme48heap.h"
  17. #include "scheme48image.h"
  18. #include "bignum.h"
  19. #include "event.h"
  20. #include "fd-io.h"
  21. extern s48_value s48_extended_vm(long, s48_value),
  22. s48_lookup_external_name(char *, char *),
  23. s48_external_call(s48_value proc,
  24. s48_value proc_name,
  25. long nargs,
  26. char *argv),
  27. s48_external_call_2(s48_value proc,
  28. s48_value proc_name,
  29. long nargs,
  30. char *argv);
  31. /*
  32. * This comes from glue.{s,c}.
  33. */
  34. extern long s48_call_native_procedure(long, long),
  35. s48_invoke_native_continuation(long, long),
  36. s48_jump_to_native_address(long, long);
  37. #define GET_PROPOSAL_LOCK() ((void)0)
  38. #define RELEASE_PROPOSAL_LOCK() ((void)0)
  39. #define SHARED_REF(x) (x)
  40. #define SHARED_SETB(x, v) ((x) = (v))
  41. extern void s48_raise_argument_type_error(s48_value);
  42. extern void s48_raise_range_error(s48_value, s48_value, s48_value);
  43. char *s48_get_os_string_encoding(void);
  44. /*
  45. * We rename these to avoid name clashes.
  46. */
  47. #define TTreturn_value s48_return_value
  48. #define TTrun_machine(x) s48_run_machine(x)