home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / Misc / CLISP-2.LHA / CLISP960530-ki.lha / ffcall / vacall / misc.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-06-25  |  2.1 KB  |  77 lines

  1. /*
  2.  * Copyright 1995 Bruno Haible, <haible@ma2s2.mathematik.uni-karlsruhe.de>
  3.  *
  4.  * This is free software distributed under the GNU General Public Licence
  5.  * described in the file COPYING. Contact the author if you don't have this
  6.  * or can't live with it. There is ABSOLUTELY NO WARRANTY, explicit or implied,
  7.  * on this software.
  8.  */
  9.  
  10. #ifndef FOR_AMIGA_CLISP
  11. #include <stdio.h>
  12. #else
  13. #include <exec/types.h>
  14. #include <exec/execbase.h>
  15. #include <proto/exec.h>
  16. extern BPTR Input_handle;
  17. extern struct ExecBase * const SysBase;
  18. #endif
  19.  
  20. #include "vacall.h"
  21. #include "config.h"
  22.  
  23. /* This is the function called by vacall(). */
  24. #if defined(__STDC__) || defined(__GNUC__)
  25. void (* vacall_function) (va_alist);
  26. #else
  27. void (* vacall_function) ();
  28. #endif
  29.  
  30. /* Room for returning structs according to the pcc non-reentrant struct return convention. */
  31. __va_struct_buffer_t __va_struct_buffer;
  32.  
  33. extern ABORT_VOLATILE RETABORTTYPE abort ();
  34.  
  35. int /* no return type, since this never returns */
  36. __va_error1 (start_type, return_type)
  37.   enum __VAtype start_type;
  38.   enum __VAtype return_type;
  39. {
  40.   /* If you see this, fix your code. */
  41. #ifndef FOR_AMIGA_CLISP
  42.   fprintf (stderr, "vacall: va_start type %d and va_return type %d disagree.\n",
  43.                    (int)start_type, (int)return_type);
  44.   abort();
  45. #else
  46.   BPTRfprintf (Input_handle, "vacall: va_start type %ld and va_return type %ld disagree.\n",
  47.                    (long)start_type, (long)return_type);
  48.   fehler_sint64(0);    /* do anything */
  49. #endif
  50. }
  51.  
  52. int /* no return type, since this never returns */
  53. __va_error2 (size)
  54.   unsigned int size;
  55. {
  56.   /* If you see this, increase __VA_ALIST_WORDS: */
  57. #ifndef FOR_AMIGA_CLISP
  58.   fprintf (stderr, "vacall: struct of size %u too large for pcc struct return.\n",
  59.                    size);
  60.   abort();
  61. #else
  62.   BPTRfprintf (Input_handle, "vacall: struct of size %lu too large for pcc struct return.\n",
  63.                    (unsigned long)size);
  64.   fehler_sint64(0);    /* do anything */
  65. #endif
  66. }
  67.  
  68. #ifdef FOR_AMIGA_CLISP
  69. /* they come from foreign.o and I have to find a libgcc for them */
  70. void __extendsfdf2()
  71. { fehler_uint64(0);
  72. }
  73. void __truncdfsf2()
  74. { fehler_uint64(0);
  75. }
  76. #endif
  77.