From 24c130bd9c6a58b3cc3c6834e7fec05e5b37d245 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Tue, 2 Nov 2021 13:08:26 +0400 Subject: [PATCH] Map RawFd to Int MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On all Unix systems, RawFd is defined as c_int. Signed-off-by: Marc-André Lureau --- docs.md | 1 + src/bindgen/ir/ty.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/docs.md b/docs.md index c4b56f9c1..726ee8382 100644 --- a/docs.md +++ b/docs.md @@ -158,6 +158,7 @@ cbindgen contains the following hardcoded mappings (again completely ignoring na * f32 => float * f64 => double * VaList => va_list +* RawFd => int * PhantomData => *evaporates*, can only appear as the field of a type * PhantomPinned => *evaporates*, can only appear as the field of a type * () => *evaporates*, can only appear as the field of a type diff --git a/src/bindgen/ir/ty.rs b/src/bindgen/ir/ty.rs index 76df353f0..d7e40c36b 100644 --- a/src/bindgen/ir/ty.rs +++ b/src/bindgen/ir/ty.rs @@ -77,6 +77,7 @@ impl PrimitiveType { "c_ulong" => (IntKind::Long, false), "c_ulonglong" => (IntKind::LongLong, false), "size_t" => (IntKind::SizeT, false), + "RawFd" => (IntKind::Int, true), "isize" | "intptr_t" => (IntKind::Size, true), "usize" | "uintptr_t" => (IntKind::Size, false),