From: Michael Beck Date: Thu, 2 Dec 2004 16:08:54 +0000 (+0000) Subject: Renamaed host.h to align.h, removed unneeded things X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=7461a0fe08bc0477e2c8eb6392278df5e2918c65;p=libfirm Renamaed host.h to align.h, removed unneeded things [r4545] --- diff --git a/ir/adt/align.h b/ir/adt/align.h new file mode 100644 index 000000000..ec058d639 --- /dev/null +++ b/ir/adt/align.h @@ -0,0 +1,56 @@ +/* + * Project: libFIRM + * File name: ir/adt/align.h + * Purpose: macros for alignment. + * Author: Markus Armbruster + * Modified by: + * Created: 1999 by getting from fiasco + * CVS-ID: $Id$ + * Copyright: (c) 1995, 1996 Markus Armbruster + * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE. + */ +#ifndef _ALIGN_H +#define _ALIGN_H + +#include + +/** + * @file host.h + */ + +/** A size handled efficiently by malloc(), at least 1K. */ +#define PREF_MALLOC_SIZE 2048 + + +/** A wrapper around GNU C's __attribute__ */ + +/* According to the documentation, the attributes we are interested in + work with 2.5, but we encountered trouble before 2.7. */ +#if defined (__GNUC__) && __GNUC__ >= 2 && __GNUC_MINOR__ >= 7 +# define HAVE_ATTRIBUTE 1 +# define ATTRIBUTE(attrs) __attribute__ (attrs) +#else +# define ATTRIBUTE(attrs) +#endif + + +/* Alignment */ + +/** A type that has most constrained alignment. */ +typedef union { + long double d; + void *p; + long l; +} aligned_type ATTRIBUTE ((aligned)); + +/** Inquiring about the alignment of a type. */ +#ifdef __GNUC__ +# define ALIGNOF(type) __alignof__ (type) +#else +# define ALIGNOF(type) offsetof (struct { char c; type d; }, d) +#endif + +/** Maximal alignment required for any type. */ +#define MAX_ALIGN ALIGNOF (aligned_type) + +#endif /* _ALIGN_H */ diff --git a/ir/adt/host.h b/ir/adt/host.h deleted file mode 100644 index 42dac6127..000000000 --- a/ir/adt/host.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Project: libFIRM - * File name: ir/adt/host.h - * Purpose: Declarations describing the host machine and C compiler. - * Author: Markus Armbruster - * Modified by: - * Created: 1999 by getting from fiasco - * CVS-ID: $Id$ - * Copyright: (c) 1995, 1996 Markus Armbruster - * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE. - */ - -#ifndef _HOST_H -#define _HOST_H - -#include - -/** - * @file host.h - */ - -/** A size handled efficiently by malloc(), at least 1K. */ -#define PREF_MALLOC_SIZE 2048 - - -/** A wrapper around GNU C's __attribute__ */ - -/* According to the documentation, the attributes we are interested in - work with 2.5, but we encountered trouble before 2.7. */ -#if defined (__GNUC__) && __GNUC__ >= 2 && __GNUC_MINOR__ >= 7 -# define HAVE_ATTRIBUTE 1 -# define ATTRIBUTE(attrs) __attribute__ (attrs) -#else -# define ATTRIBUTE(attrs) -#endif - - -/* Alignment */ - -/** A type that has most constrained alignment. */ -typedef union { - long double d; - void *p; - long l; -} aligned_type ATTRIBUTE ((aligned)); - -/** Inquiring about the alignment of a type. */ -#ifdef __GNUC__ -# define ALIGNOF(type) __alignof__ (type) -#else -# define ALIGNOF(type) offsetof (struct { char c; type d; }, d) -#endif - -/** Maximal alignment required for any type. */ -#define MAX_ALIGN ALIGNOF (aligned_type) - -#endif