Make fc-arch stuff cross-compiling-safe
[platform/upstream/fontconfig.git] / src / fcarch.c
1 /*
2  * Copyright © 2002 Keith Packard
3  *
4  * Permission to use, copy, modify, distribute, and sell this software and its
5  * documentation for any purpose is hereby granted without fee, provided that
6  * the above copyright notice appear in all copies and that both that
7  * copyright notice and this permission notice appear in supporting
8  * documentation, and that the name of the author(s) not be used in
9  * advertising or publicity pertaining to distribution of the software without
10  * specific, written prior permission.  The authors make no
11  * representations about the suitability of this software for any purpose.  It
12  * is provided "as is" without express or implied warranty.
13  *
14  * THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
15  * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
16  * EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
17  * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
18  * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
19  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
20  * PERFORMANCE OF THIS SOFTWARE.
21  */
22
23 #include <stdio.h>
24
25 #ifdef HAVE_CONFIG_H
26 #include <config.h>
27 #endif
28
29 /* If architecture is hardcoded, skip the assert tests */
30
31 #ifndef FC_ARCHITECTURE
32
33 #include "fcarch.h"
34
35 /* Make sure the cache structure is consistent with what we expect */
36
37 #include "fcint.h"
38
39 FC_ASSERT_STATIC (1 == sizeof (char));
40 FC_ASSERT_STATIC (2 == sizeof (FcChar16));
41 FC_ASSERT_STATIC (4 == sizeof (int));
42 FC_ASSERT_STATIC (4 == sizeof (FcChar32));
43 FC_ASSERT_STATIC (4 == sizeof (FcObject));
44 FC_ASSERT_STATIC (4 == sizeof (FcValueBinding));
45 FC_ASSERT_STATIC (8 == sizeof (FcAlign));
46 FC_ASSERT_STATIC (0x20 == sizeof (FcCharLeaf));
47
48 FC_ASSERT_STATIC (SIZEOF_VOID_P == sizeof (intptr_t));
49 FC_ASSERT_STATIC (SIZEOF_VOID_P == sizeof (FcPatternEltPtr));
50 FC_ASSERT_STATIC (SIZEOF_VOID_P == sizeof (FcValueListPtr));
51 FC_ASSERT_STATIC (SIZEOF_VOID_P == sizeof (char *));
52 FC_ASSERT_STATIC (SIZEOF_VOID_P == sizeof (struct FcPatternElt *));
53 FC_ASSERT_STATIC (SIZEOF_VOID_P == sizeof (FcValueList *));
54 FC_ASSERT_STATIC (SIZEOF_VOID_P == sizeof (FcStrSet *));
55 FC_ASSERT_STATIC (SIZEOF_VOID_P == sizeof (FcCharLeaf **));
56 FC_ASSERT_STATIC (SIZEOF_VOID_P == sizeof (FcChar16 *));
57
58 FC_ASSERT_STATIC (0x08 + 1*SIZEOF_VOID_P == sizeof (FcValue));
59 FC_ASSERT_STATIC (0x00 + 2*SIZEOF_VOID_P == sizeof (FcPatternElt));
60 FC_ASSERT_STATIC (0x08 + 2*SIZEOF_VOID_P == sizeof (FcPattern));
61 FC_ASSERT_STATIC (0x08 + 2*SIZEOF_VOID_P == sizeof (FcCharSet));
62 FC_ASSERT_STATIC (0x08 + 6*SIZEOF_VOID_P == sizeof (FcCache));
63
64 #endif
65
66
67 int
68 main (int argc, char **argv)
69 {
70     printf ("%s\n", FC_ARCHITECTURE);
71     return 0;
72 }