home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Internet 2000 May / MICD_2000_05.iso / CBuilder5 / INSTALL / DATA1.CAB / Program_Built_Files / Include / rpc.h < prev    next >
C/C++ Source or Header  |  2000-02-01  |  4KB  |  202 lines

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