Typo fixed.
[libfirm] / ir / adt / host.h
1 /* Declarations describing the host machine and C compiler.
2    Copyright (C) 1995, 1996 Markus Armbruster
3    All rights reserved.*/
4
5 /* $Id$ */
6
7 #ifndef _HOST_H
8 #define _HOST_H
9
10 #include <stddef.h>
11
12 /**
13  * @file host.h
14  */
15
16 /** A size handled efficiently by malloc(), at least 1K.  */
17 #define PREF_MALLOC_SIZE 2048
18
19
20 /** A wrapper around GNU C's __attribute__ */
21
22 /* According to the documentation, the attributes we are interested in
23    work with 2.5, but we encountered trouble before 2.7.  */
24 #if defined (__GNUC__) && __GNUC__ >= 2 && __GNUC_MINOR__ >= 7
25 # define HAVE_ATTRIBUTE 1
26 # define ATTRIBUTE(attrs) __attribute__ (attrs)
27 #else
28 # define ATTRIBUTE(attrs)
29 #endif
30
31
32 /* Alignment */
33
34 /** A type that has most constrained alignment.  */
35 typedef union {
36   long double d;
37   void *p;
38   long l;
39 } aligned_type ATTRIBUTE ((aligned));
40
41 /** Inquiring about the alignment of a type.  */
42 #ifdef __GNUC__
43 # define ALIGNOF(type) __alignof__ (type)
44 #else
45 # define ALIGNOF(type) offsetof (struct { char c; type d; }, d)
46 #endif
47
48 /** Maximal alignment required for any type.  */
49 #define MAX_ALIGN ALIGNOF (aligned_type)
50
51 #endif