1 /*++
2
3 Copyright (c) Microsoft Corporation. All rights reserved.
4
5 Module Name:
6
7       rpc.h
8
9 Abstract:
10
11       Master include file for RPC applications.
12
13 --*/
14
15 #if !defined( RPC_NO_WINDOWS_H ) && !defined( MAC ) && !defined( _MAC ) && !defined(_KRPCENV_)
16 #include <windows.h>
17 #endif // RPC_NO_WINDOWS_H
18
19 #ifndef __RPC_H__
20 #define __RPC_H__
21
22 #if _MSC_VER > 1000
23 #pragma once
24 #endif
25
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29
30 //-------------------------------------------------------------
31 // platform specific defines
32 //-------------------------------------------------------------
33
34 //-------------------  MAC ---------------------------
35 #if defined( MAC ) || defined( _MAC )
36
37 #define __RPC_MAC__
38 // Set the packing level for RPC structures.
39
40 #include <pshpack2.h>
41
42 //-------------------  WIN32 ---------------------------
43 #else // win32 platforms
44
45 #include <basetsd.h>
46
47 #if defined(_M_IA64) || defined(_M_AMD64)
48 #define __RPC_WIN64__
49 #else
50 #define __RPC_WIN32__
51 #endif
52
53 #endif
54
55 #if defined(__RPC_WIN64__)
56 #include <pshpack8.h>
57 #endif
58
59 #ifndef __MIDL_USER_DEFINED
60 #define midl_user_allocate MIDL_user_allocate
61 #define midl_user_free        MIDL_user_free
62 #define __MIDL_USER_DEFINED
Lines 63 ... 72 are skipped.
73 #endif
74
75 #if !defined(__RPC_MAC__) && ( (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED) )
76 #    define __RPC_API  __stdcall
77 #    define __RPC_USER __stdcall
78 #    define __RPC_STUB __stdcall
79 #    define  RPC_ENTRY __stdcall
80 #else // Not Win32/Win64
81 #    define __RPC_API
82 #    define __RPC_USER
83 #    define __RPC_STUB
84 #    define RPC_ENTRY
85 #endif
86
87 #define __RPC_FAR
88
89 // Some RPC platforms don't define DECLSPEC_IMPORT
90 #if !defined(DECLSPEC_IMPORT)
91 #if (defined(_M_MRX000) || defined(_M_IX86) || defined(_M_IA64) || defined(_M_AMD64)) && !defined(MIDL_PASS)
92 #define DECLSPEC_IMPORT __declspec(dllimport)
93 #else
94 #define DECLSPEC_IMPORT
95 #endif
96 #endif
97
98 #if !defined(_RPCRT4_) && !defined(_KRPCENV_)
99 #define RPCRTAPI DECLSPEC_IMPORT
100 #else
101 #define RPCRTAPI
102 #endif
103
104 #if !defined(_RPCNS4_)
105 #define RPCNSAPI DECLSPEC_IMPORT
106 #else
107 #define RPCNSAPI
108 #endif
109
110 #ifdef __RPC_MAC__
111
112 #include <setjmp.h>
113
114 #define RPCXCWORD (sizeof(jmp_buf)/sizeof(int))
115
116 #if _MSC_VER >= 1200
117 #pragma warning(push)
118 #endif
119 #pragma warning( disable: 4005 )
120 #include <rpcdce.h>
121 #include <rpcnsi.h>
122 #include <rpcerr.h>
123 #include <rpcmac.h>
124 #if _MSC_VER >= 1200
125 #pragma warning(pop)
126 #else
127 #pragma warning( default :  4005 )
128 #endif
129
130 typedef void  (RPC_ENTRY *MACYIELDCALLBACK)(/*OSErr*/ short *) ;
131 RPC_STATUS RPC_ENTRY
132 RpcMacSetYieldInfo(
133     MACYIELDCALLBACK pfnCallback) ;
134
135 #if !defined(UNALIGNED)
136 #define UNALIGNED
137 #endif
138
139 #include <poppack.h>
140
141 #else // __RPC_MAC__
142
143 #include <rpcdce.h>
144 #if !defined(_KRPCENV_)
145 #include <rpcnsi.h>
146 #endif // _KRPCENV_
147 #include <rpcnterr.h>
148 #include <excpt.h>
149 #if !defined(_KRPCENV_)
150 #include <winerror.h>
151 #endif // _KRPCENV_
152
153 #define RpcTryExcept \
154       __try \
155              {
156
157 // trystmts
158
159 #define RpcExcept(expr) \
160              } \
161       __except (expr) \
162              {
163
164 // exceptstmts
165
166 #define RpcEndExcept \
167              }
168
169 #define RpcTryFinally \
170       __try \
171              {
172
173 // trystmts
174
175 #define RpcFinally \
176              } \
177       __finally \
178              {
179
180 // finallystmts
181
182 #define RpcEndFinally \
183              }
184
185 #define RpcExceptionCode() GetExceptionCode()
186 #define RpcAbnormalTermination() AbnormalTermination()
187
188 #endif // __RPC_MAC__
189
190 // Definitions which depend on windows.h
191 #if (!defined( RPC_NO_WINDOWS_H ) && !defined(__RPC_MAC__)) || defined(_KRPCENV_)
192
193 #include <rpcasync.h>
194
195 #endif // RPC_NO_WINDOWS_H
196
197 #if defined(__RPC_WIN64__)
198 #include <poppack.h>
199 #endif
200
201 #ifdef __cplusplus
202 }
203 #endif
204
205 #endif // __RPC_H__
206
207
208