File: dtoh_AliasDeclaration.d

package info (click to toggle)
gcc-arm-none-eabi 15%3A14.2.rel1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,099,328 kB
  • sloc: cpp: 3,627,108; ansic: 2,571,498; ada: 834,230; f90: 235,082; makefile: 79,231; asm: 74,984; xml: 51,692; exp: 39,736; sh: 33,298; objc: 15,629; python: 15,069; fortran: 14,429; pascal: 7,003; awk: 5,070; perl: 3,106; ml: 285; lisp: 253; lex: 204; haskell: 135
file content (216 lines) | stat: -rw-r--r-- 2,940 bytes parent folder | download
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
/+
REQUIRED_ARGS: -HC=silent -c -o- -Icompilable/extra-files
PERMUTE_ARGS:
EXTRA_FILES: extra-files/dtoh_imports.d extra-files/dtoh_imports2.d

TEST_OUTPUT:
---
// Automatically generated by Digital Mars D Compiler

#pragma once

#include <assert.h>
#include <math.h>
#include <stddef.h>
#include <stdint.h>

#ifdef CUSTOM_D_ARRAY_TYPE
#define _d_dynamicArray CUSTOM_D_ARRAY_TYPE
#else
/// Represents a D [] array
template<typename T>
struct _d_dynamicArray final
{
    size_t length;
    T *ptr;

    _d_dynamicArray() : length(0), ptr(NULL) { }

    _d_dynamicArray(size_t length_in, T *ptr_in)
        : length(length_in), ptr(ptr_in) { }

    T& operator[](const size_t idx) {
        assert(idx < length);
        return ptr[idx];
    }

    const T& operator[](const size_t idx) const {
        assert(idx < length);
        return ptr[idx];
    }
};
#endif

class C;

extern void importFunc();

class ImportsC
{
};

typedef int32_t MyStdcInt;

enum
{
    IgnoreErrors = 0,
};

typedef int32_t T;

extern "C" int32_t x;

extern "C" int32_t foo(int32_t x);

extern int32_t foo2(int32_t x);

struct S;

typedef S aliasS;

struct S2;

typedef S2 aliasS2;

typedef C* aliasC;

class C2;

typedef C2* aliasC2;

typedef size_t(*F)(size_t x);

template <typename T, typename U>
struct TS final
{
    TS()
    {
    }
};

template <typename T, typename U>
using TSD = TS<T, U>;
typedef TSD<int32_t, int16_t > TSI;

using aliasName = ImportsC;

using MyStdc = MyStdcInt;

struct FullImport final
{
    using ImportsC = ::ImportsC;
    using MyStdcInt = ::MyStdcInt;
    FullImport()
    {
    }
};

struct SelectiveImports final
{
    using aliasName = ::ImportsC;
    SelectiveImports()
    {
    }
};

struct PrivateImport final
{
    PrivateImport()
    {
    }
};

typedef /* noreturn */ char Impossible[0];

template <typename T>
struct Array final
{
    uint32_t length;
    Array()
    {
    }
};

typedef Array<char > DString;
---
+/

extern (C++):

alias T = int;

extern (C) int x;

alias u = x;

extern (C) int foo(int x)
{
    return x * 42;
}

alias fun = foo;

extern (C++) int foo2(int x)
{
    return x * 42;
}

alias fun2 = foo2;

extern (C) struct S;

alias aliasS = S;

extern (C++) struct S2;

alias aliasS2 = S2;

extern (C) class C;

alias aliasC = C;

extern (C++) class C2;

alias aliasC2 = C2;

alias F = size_t function (size_t x);

extern(C++) struct TS(T, U) {}
alias TSD = TS;
alias TSI = TSD!(int, short);

public import dtoh_imports :
    importFunc,
    aliasName = ImportsC,
    MyStdc = MyStdcInt;

struct FullImport
{
    public import dtoh_imports;

}

struct SelectiveImports
{
    public import dtoh_imports :
        importFunc,
        aliasName = ImportsC;

    public static import dtoh_imports;
}

struct PrivateImport
{
    import dtoh_imports;

}

alias Impossible = noreturn;

struct Array(T)
{
    uint length;
    alias opDollar = length;
    alias dim = length;
}
alias DString = Array!(char);