xref: /titanic_52/usr/src/common/ficl/ficlplatform/unix.h (revision ccdeb6b6d71f3c9aa7e78b688f7b34fff109a817)
1 /*
2  * This file and its contents are supplied under the terms of the
3  * Common Development and Distribution License ("CDDL"), version 1.0.
4  * You may only use this file in accordance with the terms of version
5  * 1.0 of the CDDL.
6  *
7  * A full copy of the text of the CDDL should have accompanied this
8  * source.  A copy of the CDDL is also available via the Internet at
9  * http://www.illumos.org/license/CDDL.
10  */
11 
12 /*
13  * Copyright 2015 Toomas Soome <tsoome@me.com>
14  */
15 
16 #ifndef _UNIX_H
17 #define	_UNIX_H
18 
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22 
23 #define	FICL_WANT_PLATFORM (1)
24 
25 #define	FICL_PLATFORM_OS		"Illumos"
26 #ifdef __sparc
27 #define	FICL_PLATFORM_ARCHITECTURE	"sparc"
28 #else
29 #define	FICL_PLATFORM_ARCHITECTURE	"i386"
30 #endif
31 
32 #define	FICL_PLATFORM_BASIC_TYPES	(1)
33 #if defined(_LP64)
34 #define	FICL_PLATFORM_ALIGNMENT		(8)
35 #else
36 #define	FICL_PLATFORM_ALIGNMENT		(4)
37 #endif
38 #define	FICL_PLATFORM_INLINE		inline
39 
40 #define	FICL_PLATFORM_HAS_FTRUNCATE	(1)
41 #if defined(_LP64)
42 #define	FICL_PLATFORM_HAS_2INTEGER	(0)
43 #else
44 #define	FICL_PLATFORM_HAS_2INTEGER	(1)
45 #endif
46 
47 typedef int8_t ficlInteger8;
48 typedef uint8_t ficlUnsigned8;
49 typedef int16_t ficlInteger16;
50 typedef uint16_t ficlUnsigned16;
51 typedef int32_t ficlInteger32;
52 typedef uint32_t ficlUnsigned32;
53 typedef int64_t ficlInteger64;
54 typedef uint64_t ficlUnsigned64;
55 
56 #if defined(_LP64)
57 typedef ficlInteger64 ficlInteger;
58 typedef ficlUnsigned64 ficlUnsigned;
59 
60 typedef double ficlFloat;
61 #else /* default */
62 typedef ficlInteger32 ficlInteger;
63 typedef ficlUnsigned32 ficlUnsigned;
64 
65 typedef float ficlFloat;
66 #endif
67 
68 #if defined(FICL_PLATFORM_HAS_2INTEGER) && FICL_PLATFORM_HAS_2INTEGER
69 typedef ficlInteger64 ficl2Integer;
70 typedef ficlUnsigned64 ficl2Unsigned;
71 #endif
72 
73 #ifdef __cplusplus
74 }
75 #endif
76 
77 #endif /* _UNIX_H */
78