1 | /******************************************************************* |
---|
2 | * File: omDerivedConfig.h.in |
---|
3 | * Purpose: configuration which are derived from omConfig.h |
---|
4 | * Author: obachman (Olaf Bachmann) |
---|
5 | * Created: 11/99 |
---|
6 | * Version: $Id: omDerivedConfig.h,v 1.5 2001-04-30 09:02:05 Singular Exp $ |
---|
7 | *******************************************************************/ |
---|
8 | #ifndef OM_DERIVED_CONFIG_H |
---|
9 | #define OM_DERIVED_CONFIG_H |
---|
10 | |
---|
11 | #ifndef SIZEOF_VOIDP |
---|
12 | /* configure makes sure that SIZEOF_VOIDP == SIZEOF_LONG */ |
---|
13 | #define SIZEOF_VOIDP SIZEOF_LONG |
---|
14 | #endif |
---|
15 | |
---|
16 | /* SIZEOF_VOIDP == 8 || SIZEOF_VOIDP == 4 checked by configure */ |
---|
17 | #if SIZEOF_VOIDP == 8 |
---|
18 | #define LOG_SIZEOF_LONG 3 |
---|
19 | #define LOG_SIZEOF_VOIDP 3 |
---|
20 | #define LOG_BIT_SIZEOF_LONG 6 |
---|
21 | #else |
---|
22 | #define LOG_SIZEOF_LONG 2 |
---|
23 | #define LOG_SIZEOF_VOIDP 2 |
---|
24 | #define LOG_BIT_SIZEOF_LONG 5 |
---|
25 | #endif |
---|
26 | |
---|
27 | /* SIZEOF_SYSTEM_PAGE == 4096 || SIZEOF_SYSTEM_PAGE == 8192 checked by configure */ |
---|
28 | #if SIZEOF_SYSTEM_PAGE == 8192 |
---|
29 | #define LOG_BIT_SIZEOF_SYSTEM_PAGE 13 |
---|
30 | #else |
---|
31 | #define LOG_BIT_SIZEOF_SYSTEM_PAGE 12 |
---|
32 | #endif |
---|
33 | |
---|
34 | #ifndef CHAR_BIT |
---|
35 | #define CHAR_BIT 8 |
---|
36 | #endif |
---|
37 | |
---|
38 | #ifndef BIT_SIZEOF_LONG |
---|
39 | #define BIT_SIZEOF_LONG (CHAR_BIT << LOG_SIZEOF_LONG) |
---|
40 | #endif |
---|
41 | |
---|
42 | #ifdef OM_ALIGN_8 |
---|
43 | #define SIZEOF_OM_ALIGNMENT 8 |
---|
44 | #define SIZEOF_OM_ALIGNMENT_1 7 |
---|
45 | #define LOG_SIZEOF_OM_ALIGNMENT 3 |
---|
46 | #define SIZEOF_STRICT_ALIGNMENT 8 |
---|
47 | #else |
---|
48 | #define SIZEOF_OM_ALIGNMENT 4 |
---|
49 | #define SIZEOF_OM_ALIGNMENT_1 3 |
---|
50 | #define LOG_SIZEOF_OM_ALIGNMENT 2 |
---|
51 | #ifdef OM_ALIGNMENT_NEEDS_WORK |
---|
52 | #define SIZEOF_STRICT_ALIGNMENT 8 |
---|
53 | #else |
---|
54 | #define SIZEOF_STRICT_ALIGNMENT 4 |
---|
55 | #endif |
---|
56 | #endif |
---|
57 | |
---|
58 | #define OM_ALIGN_SIZE(size) \ |
---|
59 | ((((unsigned long) size) + SIZEOF_OM_ALIGNMENT_1) & (~SIZEOF_OM_ALIGNMENT_1)) |
---|
60 | |
---|
61 | #define OM_IS_ALIGNED(what) \ |
---|
62 | ((((unsigned long) what) & SIZEOF_OM_ALIGNMENT_1) == 0) |
---|
63 | |
---|
64 | #define OM_STRICT_ALIGN_SIZE(size) \ |
---|
65 | ((((size_t) (size)) + SIZEOF_STRICT_ALIGNMENT - 1) & (~ (SIZEOF_STRICT_ALIGNMENT - 1))) |
---|
66 | |
---|
67 | #define OM_IS_STRICT_ALIGNED(what) \ |
---|
68 | ((((unsigned long) what) & (SIZEOF_STRICT_ALIGNMENT -1)) == 0) |
---|
69 | |
---|
70 | #if defined(OM_NDEBUG) && defined(OM_HAVE_TRACK) |
---|
71 | #undef OM_HAVE_TRACK |
---|
72 | #endif |
---|
73 | |
---|
74 | /* define to enable assume */ |
---|
75 | #ifndef HAVE_OM_ASSUME |
---|
76 | #if defined(OM_INTERNAL_DEBUG) |
---|
77 | #define HAVE_OM_ASSUME |
---|
78 | #endif |
---|
79 | #endif |
---|
80 | |
---|
81 | /* set to 0 to disable aso memory mamagent */ |
---|
82 | #ifndef HAVE_ASO |
---|
83 | #define HAVE_ASO 1 |
---|
84 | #endif |
---|
85 | #if defined(HAVE_ASO) && HAVE_ASO == 1 |
---|
86 | /* define to enable ASO debugging */ |
---|
87 | #undef ASO_DEBUG |
---|
88 | #endif |
---|
89 | |
---|
90 | #ifndef NULL |
---|
91 | #define NULL ((void*)0) |
---|
92 | #endif |
---|
93 | |
---|
94 | #if !defined(OM_TRACK_FILE_LINE) && ! defined(OM_TRACK_RETURN) |
---|
95 | #define OM_TRACK_FILE_LINE |
---|
96 | #endif |
---|
97 | |
---|
98 | /* The following macros save a lot of typing */ |
---|
99 | #ifdef OM_TRACK_FILE_LINE |
---|
100 | #define OM_FL_DECL const char* f, const int l |
---|
101 | #define OM_FL_VAL f, l |
---|
102 | #define OM_FL __FILE__,__LINE__ |
---|
103 | #define OM_FL_KOMMA , |
---|
104 | #else |
---|
105 | #define OM_FL_DECL |
---|
106 | #define OM_FL_VAL |
---|
107 | #define OM_FL |
---|
108 | #define OM_FL_KOMMA |
---|
109 | #endif |
---|
110 | |
---|
111 | #define OM_CFL_DECL char check OM_FL_KOMMA OM_FL_DECL |
---|
112 | #define OM_CFL_VAL check OM_FL_KOMMA OM_FL_VAL |
---|
113 | #define OM_CFL OM_CHECK OM_FL_KOMMA OM_FL |
---|
114 | |
---|
115 | #define OM_TFL_DECL char track OM_FL_KOMMA OM_FL_DECL |
---|
116 | #define OM_TFL_VAL track OM_FL_KOMMA OM_FL_VAL |
---|
117 | #define OM_TFL OM_TRACK OM_FL_KOMMA OM_FL |
---|
118 | |
---|
119 | #define OM_CTFL_DECL char check, char track OM_FL_KOMMA OM_FL_DECL |
---|
120 | #define OM_CTFL_VAL check,track OM_FL_KOMMA OM_FL_VAL |
---|
121 | #define OM_CTFL OM_CHECK,OM_TRACK OM_FL_KOMMA OM_FL |
---|
122 | |
---|
123 | #ifdef OM_TRACK_RETURN |
---|
124 | #define OM_FLR_DECL OM_FL_DECL OM_FL_KOMMA const void* r |
---|
125 | #define OM_FLR_VAL OM_FL_VAL OM_FL_KOMMA r |
---|
126 | #define OM_FLR OM_FL OM_FL_KOMMA 0 |
---|
127 | #define OM_R_DEF void* r; GET_RET_ADDR(r) |
---|
128 | #ifdef OM_TRACK_FILE_LINE |
---|
129 | #define OM_FLR_ARG(f,l,r) f,l,r |
---|
130 | #else |
---|
131 | #define OM_FLR_ARG(f,l,r) r |
---|
132 | #endif |
---|
133 | |
---|
134 | #else |
---|
135 | |
---|
136 | #define OM_FLR_DECL OM_FL_DECL |
---|
137 | #define OM_FLR_VAL OM_FL_VAL |
---|
138 | #define OM_FLR OM_FL |
---|
139 | #define OM_R_DEF ((void)0) |
---|
140 | #define OM_FLR_ARG(f,l,r) f,l |
---|
141 | #endif |
---|
142 | |
---|
143 | #endif /* OM_DERIVED_CONFIG_H */ |
---|