Skip to content

Commit 9fce8a7

Browse files
committed
---
yaml --- r: 7255 b: refs/heads/master c: d978aac h: refs/heads/master i: 7253: 3d8cbfe 7251: 965ce32 7247: 3caee3f v: v3
1 parent 069da9e commit 9fce8a7

File tree

2 files changed

+21
-6
lines changed

2 files changed

+21
-6
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 26551e54814a13e428de4c7b1118a27fad1462cd
2+
refs/heads/master: d978aace53feef02b769515552bb2cfd024e833a

trunk/src/libcore/ctypes.rs

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,15 @@ FIXME: Add a test that uses some native code to verify these sizes,
99
which are not obviously correct for all potential platforms.
1010
*/
1111

12+
export c_int, c_uint, long, longlong, unsigned, ulong, ulonglong;
13+
export intptr_t, uintptr_t;
14+
export uint32_t;
15+
export void;
16+
export c_float, c_double;
17+
export size_t, ssize_t;
18+
export off_t, fd_t, pid_t;
19+
export enum;
20+
1221
// PORT adapt to architecture
1322

1423
/*
@@ -80,13 +89,19 @@ type uint32_t = u32;
8089
/*
8190
Type: void
8291

83-
A type, a pointer to which can be used as C `void *`
92+
A type, a pointer to which can be used as C `void *`.
8493

85-
Note that this does not directly correspond to the C `void` type,
86-
which is an incomplete type. Using pointers to this type
87-
when interoperating with C void pointers can help in documentation.
94+
The void type cannot be constructed or destructured, but using
95+
pointers to this type when interoperating with C void pointers can
96+
help in documentation.
8897
*/
89-
type void = int;
98+
tag void {
99+
// Making the only variant reference itself makes it impossible to
100+
// construct. Not exporting it makes it impossible to destructure.
101+
void_private(@void);
102+
// FIXME: #881
103+
void_private2(@void);
104+
}
90105

91106
/*
92107
Type: c_float

0 commit comments

Comments
 (0)