rpc.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. /**
  2. * This file has no copyright assigned and is placed in the Public Domain.
  3. * This file is part of the mingw-w64 runtime package.
  4. * No warranty is given; refer to the file DISCLAIMER.PD within this package.
  5. */
  6. /* Make sure we have internals defined. */
  7. #include <_mingw.h>
  8. #ifndef __OBJC__
  9. #undef interface
  10. #define interface struct
  11. #endif
  12. #ifndef RPC_NO_WINDOWS_H
  13. #include <windows.h>
  14. #endif
  15. #ifndef __RPC_H__
  16. #define __RPC_H__
  17. #ifdef __cplusplus
  18. extern "C" {
  19. #endif
  20. #include <basetsd.h>
  21. #if defined(__ia64__) || defined(__x86_64)
  22. #define __RPC_WIN64__
  23. #else
  24. #if !defined (_ARM_)
  25. #define __RPC_WIN32__
  26. #else
  27. #define __RPC_ARM32__
  28. #endif
  29. #endif
  30. #ifdef __RPC_WIN64__
  31. #include <pshpack8.h>
  32. #endif
  33. #ifndef __MIDL_USER_DEFINED
  34. #define __MIDL_USER_DEFINED
  35. #define midl_user_allocate MIDL_user_allocate
  36. #define midl_user_free MIDL_user_free
  37. #endif
  38. typedef void *I_RPC_HANDLE;
  39. typedef __LONG32 RPC_STATUS;
  40. #define RPC_UNICODE_SUPPORTED
  41. #define __RPC_FAR
  42. #if defined(_ARM_)
  43. #define __RPC_API
  44. #else
  45. #define __RPC_API __stdcall
  46. #endif
  47. #define __RPC_USER __RPC_API
  48. #define __RPC_STUB __RPC_API
  49. #define RPC_ENTRY __RPC_API
  50. #ifndef DECLSPEC_IMPORT
  51. #ifndef __WIDL__
  52. #define DECLSPEC_IMPORT __declspec(dllimport)
  53. #else
  54. #define DECLSPEC_IMPORT
  55. #endif
  56. #endif
  57. #ifndef _RPCRT4_
  58. #define RPCRTAPI DECLSPEC_IMPORT
  59. #else
  60. #define RPCRTAPI
  61. #endif
  62. #ifndef _RPCNS4_
  63. #define RPCNSAPI DECLSPEC_IMPORT
  64. #else
  65. #define RPCNSAPI
  66. #endif
  67. #include <rpcdce.h>
  68. #ifndef _KRPCENV_
  69. #include <rpcnsi.h>
  70. #endif
  71. #include <rpcnterr.h>
  72. #include <excpt.h>
  73. #include <winerror.h>
  74. /* TODO: This isn't actual working on gcc. Either we need to implement
  75. their __try/__except/__finally feature, or we need to do at least for x64
  76. emulation-code via inline-assembler ... */
  77. #define RpcTryExcept __try {
  78. #define RpcExcept(expr) } __except(expr) {
  79. #define RpcEndExcept }
  80. #define RpcTryFinally __try {
  81. #define RpcFinally } __finally {
  82. #define RpcEndFinally }
  83. #define RpcExceptionCode() GetExceptionCode()
  84. #define RpcAbnormalTermination() AbnormalTermination()
  85. #ifndef RPC_NO_WINDOWS_H
  86. #include <rpcasync.h>
  87. #endif
  88. #ifdef __RPC_WIN64__
  89. #include <poppack.h>
  90. #endif
  91. #ifdef __cplusplus
  92. }
  93. #endif
  94. #endif