re PR rtl-optimization/8492 (GCC spins forever compiling loop)
[official-gcc.git] / libffi / include / ffi_common.h
blobc9d4acf9085e157ce4d88a85c4af9384f9a61ced
1 /* -----------------------------------------------------------------------
2 ffi_common.h - Copyright (c) 1996 Cygnus Solutions
4 $Id: ffi_common.h,v 1.1.1.1 1998/11/29 16:48:16 green Exp $
6 Common internal definitions and macros. Only necessary for building
7 libffi.
8 ----------------------------------------------------------------------- */
10 #ifndef FFI_COMMON_H
11 #define FFI_COMMON_H
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
17 /* Do not move this. Some versions of AIX are very picky about where
18 this is positioned. */
19 #ifdef __GNUC__
20 # define alloca __builtin_alloca
21 #else
22 # if HAVE_ALLOCA_H
23 # include <alloca.h>
24 # else
25 # ifdef _AIX
26 #pragma alloca
27 # else
28 # ifndef alloca /* predefined by HP cc +Olibcalls */
29 char *alloca ();
30 # endif
31 # endif
32 # endif
33 #endif
35 /* Check for the existence of memcpy. */
36 #if STDC_HEADERS
37 # include <string.h>
38 #else
39 # ifndef HAVE_MEMCPY
40 # define memcpy(d, s, n) bcopy ((s), (d), (n))
41 # endif
42 #endif
44 #ifndef FALSE
45 #define FALSE 0
46 #endif
48 #ifndef TRUE
49 #define TRUE (!FALSE)
50 #endif
52 #ifndef __cplusplus
53 /* bool is a keyword in C++ */
54 /*@-cppnames@*/
55 typedef int bool;
56 /*@=cppnames@*/
57 #endif
59 #ifdef FFI_DEBUG
61 /* Debugging functions */
62 /*@exits@*/ int ffi_assert(/*@temp@*/ char *file, int line);
63 void ffi_stop_here(void);
64 bool ffi_type_test(/*@temp@*/ /*@out@*/ ffi_type *a);
66 #define FFI_ASSERT(x) ((x) ? 0 : ffi_assert(__FILE__,__LINE__))
68 #else
70 #define FFI_ASSERT(x)
72 #endif
74 /* Perform machine dependent cif processing */
75 ffi_status ffi_prep_cif_machdep(ffi_cif *cif);
77 /* Extended cif, used in callback from assembly routine */
78 typedef struct
80 /*@dependent@*/ ffi_cif *cif;
81 /*@dependent@*/ void *rvalue;
82 /*@dependent@*/ void **avalue;
83 } extended_cif;
85 #ifdef __cplusplus
87 #endif
89 #endif