source: trunk/include/odinwrap.h@ 473

Last change on this file since 473 was 473, checked in by phaller, 26 years ago

Add: ODIN FS selector wrapper macros added

File size: 9.5 KB
Line 
1/* $Id: odinwrap.h,v 1.1 1999-08-11 12:46:00 phaller Exp $ */
2
3/*
4 * Project Odin Software License can be found in LICENSE.TXT
5 *
6 * ODIN FS: Selector function wrapper macros
7 *
8 * Copyright 1999 Patrick Haller
9 *
10 */
11
12
13#ifndef _ODINWRAP_H_
14#define _ODINWARP_H_
15
16
17/****************************************************************************
18 * Defines *
19 ****************************************************************************/
20
21#define ODIN_INTERNAL _Optlink
22
23
24/****************************************************************************
25 * General Wrapper Macros *
26 ****************************************************************************/
27
28/* ---------- 0 parameters ---------- */
29#define ODINFUNCTION0(cRet,cName) \
30 cRet ODIN_INTERNAL cName (void);\
31 cRet WINAPI ODIN_##cName(void) \
32 { \
33 unsigned short sel = RestoreOS2FS(); \
34 cRet rc = cName(); \
35 SetFS(sel); \
36 return rc; \
37 } \
38 \
39 cRet ODIN_INTERNAL cName (void)
40
41
42#define ODINPROCEDURE0(cName) \
43 void ODIN_INTERNAL cName (void);\
44 void WINAPI ODIN_##cName(void) \
45 { \
46 unsigned short sel = RestoreOS2FS(); \
47 cName(); \
48 SetFS(sel); \
49 } \
50 \
51 void ODIN_INTERNAL cName (void)
52
53
54/* ---------- 1 parameters ---------- */
55#define ODINFUNCTION1(cRet,cName,t1,a1) \
56 cRet ODIN_INTERNAL cName (t1 a1);\
57 cRet WINAPI ODIN_##cName(t1 a1) \
58 { \
59 unsigned short sel = RestoreOS2FS(); \
60 cRet rc = cName(a1); \
61 SetFS(sel); \
62 return rc; \
63 } \
64 \
65 cRet ODIN_INTERNAL cName (t1 a1)
66
67#define ODINPROCEDURE1(cName,t1,a1) \
68 void ODIN_INTERNAL cName (t1 a1);\
69 void WINAPI ODIN_##cName(t1 a1) \
70 { \
71 unsigned short sel = RestoreOS2FS(); \
72 cName(a1); \
73 SetFS(sel); \
74 } \
75 \
76 void ODIN_INTERNAL cName (t1 a1)
77
78
79/* ---------- 2 parameters ---------- */
80#define ODINFUNCTION2(cRet,cName,t1,a1,t2,a2) \
81 cRet ODIN_INTERNAL cName (t1 a1,t2 a2); \
82 cRet WINAPI ODIN_##cName(t1 a1,t2 a2) \
83 { \
84 unsigned short sel = RestoreOS2FS(); \
85 cRet rc = cName(a1,a2); \
86 SetFS(sel); \
87 return rc; \
88 } \
89 \
90 cRet ODIN_INTERNAL cName (t1 a1,t2 a2)
91
92#define ODINPROCEDURE2(cName,t1,a1,t2,a2) \
93 void ODIN_INTERNAL cName (t1 a1,t2 a2);\
94 void WINAPI ODIN_##cName(t1 a1,t2 a2) \
95 { \
96 unsigned short sel = RestoreOS2FS(); \
97 cName(a1,a2); \
98 SetFS(sel); \
99 } \
100 \
101 void ODIN_INTERNAL cName (t1 a1,t2 a2)
102
103
104/* ---------- 3 parameters ---------- */
105#define ODINFUNCTION3(cRet,cName,t1,a1,t2,a2,t3,a3) \
106 cRet ODIN_INTERNAL cName (t1 a1,t2 a2,t3 a3); \
107 cRet WINAPI ODIN_##cName(t1 a1,t2 a2,t3 a3) \
108 { \
109 unsigned short sel = RestoreOS2FS(); \
110 cRet rc = cName(a1,a2,a3); \
111 SetFS(sel); \
112 return rc; \
113 } \
114 \
115 cRet ODIN_INTERNAL cName (t1 a1,t2 a2,t3 a3)
116
117#define ODINPROCEDURE3(cName,t1,a1,t2,a2,t3,a3) \
118 void ODIN_INTERNAL cName (t1 a1,t2 a2,t3 a3); \
119 void WINAPI ODIN_##cName(t1 a1,t2 a2,t3 a3) \
120 { \
121 unsigned short sel = RestoreOS2FS(); \
122 cName(a1,a2,a3); \
123 SetFS(sel); \
124 } \
125 \
126 void ODIN_INTERNAL cName (t1 a1,t2 a2,t3 a3)
127
128
129/* ---------- 4 parameters ---------- */
130#define ODINFUNCTION4(cRet,cName,t1,a1,t2,a2,t3,a3,t4,a4) \
131 cRet ODIN_INTERNAL cName (t1 a1,t2 a2,t3 a3,t4 a4); \
132 cRet WINAPI ODIN_##cName(t1 a1,t2 a2,t3 a3,t4 a4) \
133 { \
134 unsigned short sel = RestoreOS2FS(); \
135 cRet rc = cName(a1,a2,a3,a4); \
136 SetFS(sel); \
137 return rc; \
138 } \
139 \
140 cRet ODIN_INTERNAL cName (t1 a1,t2 a2,t3 a3,t4 a4)
141
142#define ODINPROCEDURE4(cName,t1,a1,t2,a2,t3,a3,t4,a4) \
143 void ODIN_INTERNAL cName (t1 a1,t2 a2,t3 a3,t4 a4); \
144 void WINAPI ODIN_##cName(t1 a1,t2 a2,t3 a3,t4 a4) \
145 { \
146 unsigned short sel = RestoreOS2FS(); \
147 cName(a1,a2,a3,a4); \
148 SetFS(sel); \
149 } \
150 \
151 void ODIN_INTERNAL cName (t1 a1,t2 a2,t3 a3,t4 a4)
152
153
154/* ---------- 5 parameters ---------- */
155#define ODINFUNCTION5(cRet,cName,t1,a1,t2,a2,t3,a3,t4,a4,t5,a5) \
156 cRet ODIN_INTERNAL cName (t1 a1,t2 a2,t3 a3,t4 a4,t5 a5); \
157 cRet WINAPI ODIN_##cName(t1 a1,t2 a2,t3 a3,t4 a4,t5 a5) \
158 { \
159 unsigned short sel = RestoreOS2FS(); \
160 cRet rc = cName(a1,a2,a3,a4,a5); \
161 SetFS(sel); \
162 return rc; \
163 } \
164 \
165 cRet ODIN_INTERNAL cName (t1 a1,t2 a2,t3 a3,t4 a4,t5 a5)
166
167#define ODINPROCEDURE5(cName,t1,a1,t2,a2,t3,a3,t4,a4,t5,a5) \
168 void ODIN_INTERNAL cName (t1 a1,t2 a2,t3 a3,t4 a4,t5 a5); \
169 void WINAPI ODIN_##cName(t1 a1,t2 a2,t3 a3,t4 a4,t5 a5) \
170 { \
171 unsigned short sel = RestoreOS2FS(); \
172 cName(a1,a2,a3,a4,a5); \
173 SetFS(sel); \
174 } \
175 \
176 void ODIN_INTERNAL cName (t1 a1,t2 a2,t3 a3,t4 a4,t5 a5)
177
178
179/* ---------- 6 parameters ---------- */
180#define ODINFUNCTION6(cRet,cName,t1,a1,t2,a2,t3,a3,t4,a4,t5,a5,t6,a6) \
181 cRet ODIN_INTERNAL cName (t1 a1,t2 a2,t3 a3,t4 a4,t5 a5,t6 a6); \
182 cRet WINAPI ODIN_##cName(t1 a1,t2 a2,t3 a3,t4 a4,t5 a5,t6 a6) \
183 { \
184 unsigned short sel = RestoreOS2FS(); \
185 cRet rc = cName(a1,a2,a3,a4,a5,a6); \
186 SetFS(sel); \
187 return rc; \
188 } \
189 \
190 cRet ODIN_INTERNAL cName (t1 a1,t2 a2,t3 a3,t4 a4,t5 a5,t6 a6)
191
192#define ODINPROCEDURE6(cName,t1,a1,t2,a2,t3,a3,t4,a4,t5,a5,t6,a6) \
193 void ODIN_INTERNAL cName (t1 a1,t2 a2,t3 a3,t4 a4,t5 a5,t6 a6); \
194 void WINAPI ODIN_##cName(t1 a1,t2 a2,t3 a3,t4 a4,t5 a5,t6 a6) \
195 { \
196 unsigned short sel = RestoreOS2FS(); \
197 cName(a1,a2,a3,a4,a5,a6); \
198 SetFS(sel); \
199 } \
200 \
201 void ODIN_INTERNAL cName (t1 a1,t2 a2,t3 a3,t4 a4,t5 a5,t6 a6)
202
203
204/* ---------- 7 parameters ---------- */
205#define ODINFUNCTION7(cRet,cName,t1,a1,t2,a2,t3,a3,t4,a4,t5,a5,t6,a6,t7,a7) \
206 cRet ODIN_INTERNAL cName (t1 a1,t2 a2,t3 a3,t4 a4,t5 a5,t6 a6,t7 a7); \
207 cRet WINAPI ODIN_##cName(t1 a1,t2 a2,t3 a3,t4 a4,t5 a5,t6 a6,t7 a7) \
208 { \
209 unsigned short sel = RestoreOS2FS(); \
210 cRet rc = cName(a1,a2,a3,a4,a5,a6,a7); \
211 SetFS(sel); \
212 return rc; \
213 } \
214 \
215 cRet ODIN_INTERNAL cName (t1 a1,t2 a2,t3 a3,t4 a4,t5 a5,t6 a6,t7 a7)
216
217#define ODINPROCEDURE7(cName,t1,a1,t2,a2,t3,a3,t4,a4,t5,a5,t6,a6,t7,a7) \
218 void ODIN_INTERNAL cName (t1 a1,t2 a2,t3 a3,t4 a4,t5 a5,t6 a6,t7 a7); \
219 void WINAPI ODIN_##cName(t1 a1,t2 a2,t3 a3,t4 a4,t5 a5,t6 a6,t7 a7) \
220 { \
221 unsigned short sel = RestoreOS2FS(); \
222 cName(a1,a2,a3,a4,a5,a6,a7); \
223 SetFS(sel); \
224 } \
225 \
226 void ODIN_INTERNAL cName (t1 a1,t2 a2,t3 a3,t4 a4,t5 a5,t6 a6,t7 a7)
227
228
229/* ---------- 8 parameters ---------- */
230#define ODINFUNCTION8(cRet,cName,t1,a1,t2,a2,t3,a3,t4,a4,t5,a5,t6,a6,t7,a7,t8,a8) \
231 cRet ODIN_INTERNAL cName (t1 a1,t2 a2,t3 a3,t4 a4,t5 a5,t6 a6,t7 a7,t8 a8); \
232 cRet WINAPI ODIN_##cName(t1 a1,t2 a2,t3 a3,t4 a4,t5 a5,t6 a6,t7 a7,t8 a8) \
233 { \
234 unsigned short sel = RestoreOS2FS(); \
235 cRet rc = cName(a1,a2,a3,a4,a5,a6,a7,a8); \
236 SetFS(sel); \
237 return rc; \
238 } \
239 \
240 cRet ODIN_INTERNAL cName (t1 a1,t2 a2,t3 a3,t4,a4,t5 a5,t6 a6,t7 a7,t8 a8)
241
242#define ODINPROCEDURE8(cName,t1,a1,t2,a2,t3,a3,t4,a4,t5,a5,t6,a6,t7,a7,t8,a8) \
243 void ODIN_INTERNAL cName (t1 a1,t2 a2,t3 a3,t4 a4,t5 a5,t6 a6,t7 a7,t8 a8); \
244 void WINAPI ODIN_##cName(t1 a1,t2 a2,t3 a3,t4 a4,t5 a5,t6 a6,t7 a7,t8 a8) \
245 { \
246 unsigned short sel = RestoreOS2FS(); \
247 cName(a1,a2,a3,a4,a5,a6,a7,a8); \
248 SetFS(sel); \
249 } \
250 \
251 void ODIN_INTERNAL cName (t1 a1,t2 a2,t3 a3,t4 a4,t5 a5,t6 a6,t7 a7,t8 a8)
252
253
254
255#endif /* _ODINWRAP_H_ */
Note: See TracBrowser for help on using the repository browser.