Skip to content

Commit 863f840

Browse files
committed
Split c_ptrdiff_t.md c_size_t.md c_ssize_t.md out of primitives.rs for consistence
1 parent 41e010c commit 863f840

File tree

4 files changed

+15
-17
lines changed

4 files changed

+15
-17
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Equivalent to C's `ptrdiff_t` type, from `stddef.h` (or `cstddef` for C++).
2+
3+
This type is currently always [`isize`], however in the future there may be
4+
platforms where this is not the case.

library/core/src/ffi/c_size_t.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Equivalent to C's `size_t` type, from `stddef.h` (or `cstddef` for C++).
2+
3+
This type is currently always [`usize`], however in the future there may be
4+
platforms where this is not the case.

library/core/src/ffi/c_ssize_t.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Equivalent to C's `ssize_t` (on POSIX) or `SSIZE_T` (on Windows) type.
2+
3+
This type is currently always [`isize`], however in the future there may be
4+
platforms where this is not the case.

library/core/src/ffi/primitives.rs

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -149,23 +149,9 @@ mod c_long_definition {
149149
}
150150
}
151151

152-
/// Equivalent to C's `size_t` type, from `stddef.h` (or `cstddef` for C++).
153-
///
154-
/// This type is currently always [`usize`], however in the future there may be
155-
/// platforms where this is not the case.
156-
pub type c_size_t = usize;
157-
158-
/// Equivalent to C's `ptrdiff_t` type, from `stddef.h` (or `cstddef` for C++).
159-
///
160-
/// This type is currently always [`isize`], however in the future there may be
161-
/// platforms where this is not the case.
162-
pub type c_ptrdiff_t = isize;
163-
164-
/// Equivalent to C's `ssize_t` (on POSIX) or `SSIZE_T` (on Windows) type.
165-
///
166-
/// This type is currently always [`isize`], however in the future there may be
167-
/// platforms where this is not the case.
168-
pub type c_ssize_t = isize;
152+
type_alias! { "c_size_t.md", c_size_t = usize; }
153+
type_alias! { "c_ptrdiff_t.md", c_ptrdiff_t = isize; }
154+
type_alias! { "c_ssize_t.md", c_ssize_t = isize; }
169155

170156
mod c_int_definition {
171157
crate::cfg_select! {

0 commit comments

Comments
 (0)