aboutsummaryrefslogtreecommitdiff
path: root/x86_64-w64-mingw32/include/rpc.h
blob: c78cc339b004c379b65e74a45f5f1e5cdabd193f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
/**
 * This file has no copyright assigned and is placed in the Public Domain.
 * This file is part of the mingw-w64 runtime package.
 * No warranty is given; refer to the file DISCLAIMER.PD within this package.
 */

/* Make sure we have internals defined.  */
#include <_mingw.h>

#ifndef __OBJC__
#undef interface
#define interface struct
#endif

#ifndef RPC_NO_WINDOWS_H
#include <windows.h>
#endif

#ifndef __RPC_H__
#define __RPC_H__

#ifdef __cplusplus
extern "C" {
#endif

#include <basetsd.h>

#if defined(__ia64__) || defined(__x86_64)
#define __RPC_WIN64__
#else
#if !defined (_ARM_)
#define __RPC_WIN32__
#else
#define __RPC_ARM32__
#endif
#endif

#ifdef __RPC_WIN64__
#include <pshpack8.h>
#endif

#ifndef __MIDL_USER_DEFINED
#define __MIDL_USER_DEFINED
#define midl_user_allocate MIDL_user_allocate
#define midl_user_free MIDL_user_free
#endif

  typedef void *I_RPC_HANDLE;
  typedef __LONG32 RPC_STATUS;

#define RPC_UNICODE_SUPPORTED
#define __RPC_FAR
#if defined(_ARM_)
#define __RPC_API
#else
#define __RPC_API __stdcall
#endif
#define __RPC_USER __RPC_API
#define __RPC_STUB __RPC_API
#define RPC_ENTRY __RPC_API

#ifndef DECLSPEC_IMPORT
#ifndef __WIDL__
#define DECLSPEC_IMPORT __declspec(dllimport)
#else
#define DECLSPEC_IMPORT
#endif
#endif

#ifndef _RPCRT4_
#define RPCRTAPI DECLSPEC_IMPORT
#else
#define RPCRTAPI
#endif

#ifndef _RPCNS4_
#define RPCNSAPI DECLSPEC_IMPORT
#else
#define RPCNSAPI
#endif

#include <rpcdce.h>
#ifndef _KRPCENV_
#include <rpcnsi.h>
#endif
#include <rpcnterr.h>
#include <excpt.h>
#include <winerror.h>

/* TODO:  This isn't actual working on gcc.  Either we need to implement
   their __try/__except/__finally feature, or we need to do at least for x64
   emulation-code via inline-assembler ...  */
#define RpcTryExcept __try {
#define RpcExcept(expr) } __except(expr) {
#define RpcEndExcept }
#define RpcTryFinally __try {
#define RpcFinally } __finally {
#define RpcEndFinally }

#define RpcExceptionCode() GetExceptionCode()
#define RpcAbnormalTermination() AbnormalTermination()

#ifndef RPC_NO_WINDOWS_H
#include <rpcasync.h>
#endif

#ifdef __RPC_WIN64__
#include <poppack.h>
#endif

#ifdef __cplusplus
}
#endif
#endif