1
0
Fork 0
forked from wry/wry

all: remove extern_types feature

This commit is contained in:
Julian Orth 2024-02-22 21:47:10 +01:00
parent c99272230c
commit 3791fb9a1e
4 changed files with 40 additions and 23 deletions

View file

@ -9,14 +9,19 @@ pub type libinput_log_handler = unsafe extern "C" fn(
args: VaList,
);
#[repr(transparent)]
pub struct libinput(u8);
#[repr(transparent)]
pub struct libinput_device(u8);
#[repr(transparent)]
pub struct libinput_event(u8);
#[repr(transparent)]
pub struct libinput_event_keyboard(u8);
#[repr(transparent)]
pub struct libinput_event_pointer(u8);
#[link(name = "input")]
extern "C" {
pub type libinput;
pub type libinput_device;
pub type libinput_event;
pub type libinput_event_keyboard;
pub type libinput_event_pointer;
pub fn libinput_log_set_handler(libinput: *mut libinput, log_handler: libinput_log_handler);
pub fn libinput_log_set_priority(libinput: *mut libinput, priority: libinput_log_priority);
pub fn libinput_path_create_context(

View file

@ -1,7 +1,6 @@
#![feature(
c_variadic, // https://github.com/rust-lang/rust/issues/44930
thread_local, // https://github.com/rust-lang/rust/issues/29594
extern_types, // https://github.com/rust-lang/rust/issues/43467
c_str_literals, // https://github.com/rust-lang/rust/issues/105723
)]
#![allow(

View file

@ -14,11 +14,13 @@ pub mod consts;
include!(concat!(env!("OUT_DIR"), "/pango_tys.rs"));
#[repr(transparent)]
struct cairo_surface_t(u8);
#[repr(transparent)]
struct cairo_t(u8);
#[link(name = "cairo")]
extern "C" {
type cairo_surface_t;
type cairo_t;
fn cairo_image_surface_create(
format: cairo_format_t,
width: c::c_int,
@ -41,26 +43,30 @@ extern "C" {
fn cairo_move_to(cr: *mut cairo_t, x: f64, y: f64);
}
#[repr(transparent)]
struct PangoContext_(u8);
#[link(name = "pangocairo-1.0")]
extern "C" {
type PangoContext_;
fn pango_cairo_create_context(cr: *mut cairo_t) -> *mut PangoContext_;
fn pango_cairo_show_layout(cr: *mut cairo_t, layout: *mut PangoLayout_);
}
#[repr(transparent)]
struct GObject(u8);
#[link(name = "gobject-2.0")]
extern "C" {
type GObject;
fn g_object_unref(object: *mut GObject);
}
#[repr(transparent)]
struct PangoFontDescription_(u8);
#[repr(transparent)]
struct PangoLayout_(u8);
#[link(name = "pango-1.0")]
extern "C" {
type PangoFontDescription_;
type PangoLayout_;
fn pango_font_description_from_string(str: *const c::c_char) -> *mut PangoFontDescription_;
fn pango_font_description_free(desc: *mut PangoFontDescription_);
fn pango_font_description_get_size(desc: *mut PangoFontDescription_) -> c::c_int;

View file

@ -1,3 +1,5 @@
#![allow(non_camel_case_types)]
use {
crate::utils::oserror::OsError,
std::{ffi::CStr, marker::PhantomData, ptr, rc::Rc},
@ -5,14 +7,19 @@ use {
uapi::{c, ustr, Errno, IntoUstr, Ustr},
};
#[repr(transparent)]
struct udev(u8);
#[repr(transparent)]
struct udev_monitor(u8);
#[repr(transparent)]
struct udev_enumerate(u8);
#[repr(transparent)]
struct udev_list_entry(u8);
#[repr(transparent)]
struct udev_device(u8);
#[link(name = "udev")]
extern "C" {
type udev;
type udev_monitor;
type udev_enumerate;
type udev_list_entry;
type udev_device;
fn udev_new() -> *mut udev;
fn udev_unref(udev: *mut udev) -> *mut udev;