3 ?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi
5 ?RCS: You may redistribute only under the terms of the Artistic License,
6 ?RCS: as specified in the README file that comes with the distribution.
7 ?RCS: You may reuse parts of this distribution only within the terms of
8 ?RCS: that same Artistic License; a copy of which may be found at the root
9 ?RCS: of the source tree for dist 4.0.
11 ?RCS: $Log: alignbytes.U,v $
12 ?RCS: Revision 3.0.1.2 1994/10/29 16:02:28 ram
13 ?RCS: patch36: added ?F: line for metalint file checking
15 ?RCS: Revision 3.0.1.1 1994/05/06 14:25:20 ram
16 ?RCS: patch23: avoid ALIGNBYTES, since it conflicts on NetBSD
18 ?RCS: Revision 3.0 1993/08/18 12:05:23 ram
19 ?RCS: Baseline for dist 3.0 netwide release.
21 ?MAKE:alignbytes: Assert Myread Trylink cat i_inttypes i_limits i_math
22 ?MAKE: -pick add $@ %<
24 ?S: This variable holds the number of bytes required to align an
25 ?S: arbitrary standard type. Usual values are 2, 4 and 8.
27 ?X: This used to be called ALIGNBYTES, but that conflicts with
28 ?X: <machines/param.h> in NetBSD.
29 ?C:MEM_ALIGNBYTES (ALIGNBYTES):
30 ?C: This symbol contains the number of bytes required to align a
31 ?C: double. Usual values are 2, 4 and 8.
33 ?H:#define MEM_ALIGNBYTES $alignbytes /**/
36 : check for alignment requirements
40 echo "Checking alignment constraints..." >&4
42 for alignment in 8 4 2 1 16 32 error
45 #$i_inttypes I_INTTYPES
60 void (*func_ptr)(void);
70 #warning "LLONG_MAX undefined"
72 #if defined(HUGE_VALL)
75 #warning "HUGE_VALL undefined"
80 #warning "UINT32_MAX undefined"
85 #warning "UINT32_MAX undefined"
90 #warning "UINT64_MAX undefined"
95 #warning "UINTMAX_MAX undefined"
100 #warning "UINTPTR_MAX undefined"
109 #include "static_assert.h"
114 STATIC_ASSERT($alignment == ((sizeof (struct s) - (sizeof (union u)))));
129 echo "(I can't seem to compile the test program...)" >&4
135 *) dflt="$alignbytes"
138 rp="What is the maximum alignment in bytes required for a standard type?"