]>
Commit | Line | Data |
---|---|---|
b4c522fa | 1 | |
8e788ac6 | 2 | /* Copyright (C) 1999-2020 by The D Language Foundation, All Rights Reserved |
b4c522fa IB |
3 | * written by Walter Bright |
4 | * http://www.digitalmars.com | |
5 | * Distributed under the Boost Software License, Version 1.0. | |
6 | * http://www.boost.org/LICENSE_1_0.txt | |
7 | * https://github.com/dlang/dmd/blob/master/src/dmd/root/dcompat.h | |
8 | */ | |
9 | ||
10 | #pragma once | |
11 | ||
f9ab59ff IB |
12 | #include "dsystem.h" |
13 | ||
b4c522fa IB |
14 | /// Represents a D [ ] array |
15 | template<typename T> | |
16 | struct DArray | |
17 | { | |
18 | size_t length; | |
19 | T *ptr; | |
20 | }; | |
2cbc99d1 IB |
21 | |
22 | /// Corresponding C++ type that maps to D size_t | |
23 | #if __APPLE__ && __i386__ | |
24 | // size_t is 'unsigned long', which makes it mangle differently than D's 'uint' | |
25 | typedef unsigned d_size_t; | |
26 | #elif MARS && DMD_VERSION >= 2079 && DMD_VERSION <= 2081 && \ | |
27 | __APPLE__ && __SIZEOF_SIZE_T__ == 8 | |
28 | // DMD versions between 2.079 and 2.081 mapped D ulong to uint64_t on OS X. | |
29 | typedef uint64_t d_size_t; | |
30 | #else | |
31 | typedef size_t d_size_t; | |
32 | #endif |