aboutsummaryrefslogtreecommitdiff
path: root/contrib/DirectX-Headers-1.618.2/include/wsl/stubs/rpcndr.h
blob: 68aa3909d30faa2f92185568b59f412652f9464a (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
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

// Stub header to satisfy d3d12.h include
#pragma once

#include "basetsd.h"

#define __RPCNDR_H_VERSION__

#ifdef CONST_VTABLE
#define CONST_VTBL const
#else
#define CONST_VTBL
#endif

/* Macros for __uuidof template-based emulation */
#if defined(__cplusplus)
#if __cpp_constexpr >= 200704l && __cpp_inline_variables >= 201606L
#define __wsl_stub_uuidof_use_constexpr 1
#else
#define __wsl_stub_uuidof_use_constexpr 0
#endif
#ifndef __GNUC__
#error "Only support for compilers that support for `GNU C++ extension`"
#endif
extern "C++"                                                         {
#if __wsl_stub_uuidof_use_constexpr
    __extension__ template<typename T> struct __wsl_stub_uuidof_s;
    __extension__ template<typename T> constexpr const GUID &__wsl_stub_uuidof();
#else
    __extension__ template<typename T> const GUID &__wsl_stub_uuidof();
#endif
}

#if __wsl_stub_uuidof_use_constexpr
#define __CRT_UUID_DECL(type, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
    extern "C++"                                                         \
    {                                                                    \
        template <>                                                      \
        struct __wsl_stub_uuidof_s<type>                                 \
        {                                                                \
            static constexpr IID __uuid_inst = {                         \
                l, w1, w2, {b1, b2, b3, b4, b5, b6, b7, b8}};            \
        };                                                               \
        template <>                                                      \
        constexpr const GUID &__wsl_stub_uuidof<type>()                  \
        {                                                                \
            return __wsl_stub_uuidof_s<type>::__uuid_inst;               \
        }                                                                \
        template <>                                                      \
        constexpr const GUID &__wsl_stub_uuidof<type *>()                \
        {                                                                \
            return __wsl_stub_uuidof_s<type>::__uuid_inst;               \
        }                                                                \
    }
#else
#define __CRT_UUID_DECL(type, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
    extern "C++"                                                         \
    {                                                                    \
        template <>                                                      \
        inline const GUID &__wsl_stub_uuidof<type>()                     \
        {                                                                \
            static const IID __uuid_inst = {                             \
                l, w1, w2, {b1, b2, b3, b4, b5, b6, b7, b8}};            \
            return __uuid_inst;                                          \
        }                                                                \
        template <>                                                      \
        inline const GUID &__wsl_stub_uuidof<type *>()                   \
        {                                                                \
            return __wsl_stub_uuidof<type>();                            \
        }                                                                \
    }
#endif
#define __uuidof(type) __wsl_stub_uuidof<__typeof(type)>()
#else
#define __CRT_UUID_DECL(type, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8)
#endif