From 72703def042c041ed781e757973c4a8e339ef848 Mon Sep 17 00:00:00 2001 From: Florian Gilcher Date: Wed, 23 Dec 2015 10:31:16 +0100 Subject: [PATCH] Port cef-sys to stable Removes use of old features, uses libc from cargo and removes negated integers. --- cef-sys/Cargo.toml | 5 ++++- cef-sys/build.rs | 7 +------ cef-sys/src/lib.rs | 3 +-- cef-sys/src/mac.rs | 9 +++++---- 4 files changed, 11 insertions(+), 13 deletions(-) diff --git a/cef-sys/Cargo.toml b/cef-sys/Cargo.toml index 32db882..5a16bd2 100644 --- a/cef-sys/Cargo.toml +++ b/cef-sys/Cargo.toml @@ -14,4 +14,7 @@ license = "MIT" links = "cef" build = "build.rs" -exclude = [ "*~", "*.racertmp" ] \ No newline at end of file +exclude = [ "*~", "*.racertmp" ] + +[dependencies] +libc = "0.2.4" \ No newline at end of file diff --git a/cef-sys/build.rs b/cef-sys/build.rs index ef26fee..ab89467 100644 --- a/cef-sys/build.rs +++ b/cef-sys/build.rs @@ -1,8 +1,3 @@ -#![feature(result_expect, path_ext)] - -//use std::os; -//use std::old_io::fs::PathExtensions; - enum Platform { Windows, Mac, @@ -20,8 +15,8 @@ fn get_platform() -> Platform { fn main() { use std::path::Path; - use std::fs::PathExt; use std::env::consts; + let dll_name = match get_platform() { Platform::Mac => return, // CEF_PATH is not necessarily needed for Mac Platform::Windows => "libcef", diff --git a/cef-sys/src/lib.rs b/cef-sys/src/lib.rs index 3aadc2c..43c7b18 100644 --- a/cef-sys/src/lib.rs +++ b/cef-sys/src/lib.rs @@ -1,5 +1,4 @@ -#![feature(libc, negate_unsigned)] -#![allow(non_camel_case_types, non_snake_case, raw_pointer_derive, missing_copy_implementations, improper_ctypes)] +#![allow(non_camel_case_types, non_snake_case, missing_copy_implementations, improper_ctypes)] extern crate libc; #[cfg(target_os="linux")] diff --git a/cef-sys/src/mac.rs b/cef-sys/src/mac.rs index 2d05d3b..3150610 100644 --- a/cef-sys/src/mac.rs +++ b/cef-sys/src/mac.rs @@ -1,6 +1,7 @@ use libc::size_t; use libc::wchar_t; use libc::time_t; +use std::u32; /* automatically generated by rust-bindgen */ @@ -306,7 +307,7 @@ pub const DRAG_OPERATION_GENERIC: ::libc::c_uint = 4; pub const DRAG_OPERATION_PRIVATE: ::libc::c_uint = 8; pub const DRAG_OPERATION_MOVE: ::libc::c_uint = 16; pub const DRAG_OPERATION_DELETE: ::libc::c_uint = 32; -pub const DRAG_OPERATION_EVERY: ::libc::c_uint = -1; +pub const DRAG_OPERATION_EVERY: ::libc::c_uint = u32::MAX; pub type cef_drag_operations_mask_t = Enum_Unnamed7; pub type Enum_Unnamed8 = ::libc::c_uint; pub const V8_ACCESS_CONTROL_DEFAULT: ::libc::c_uint = 0; @@ -356,9 +357,9 @@ pub const TT_FORWARD_BACK_FLAG: ::libc::c_uint = 16777216; pub const TT_CHAIN_START_FLAG: ::libc::c_uint = 268435456; pub const TT_CHAIN_END_FLAG: ::libc::c_uint = 536870912; pub const TT_CLIENT_REDIRECT_FLAG: ::libc::c_uint = 1073741824; -pub const TT_SERVER_REDIRECT_FLAG: ::libc::c_uint = -2147483648; -pub const TT_IS_REDIRECT_MASK: ::libc::c_uint = -1073741824; -pub const TT_QUALIFIER_MASK: ::libc::c_uint = -256; +pub const TT_SERVER_REDIRECT_FLAG: ::libc::c_uint = 0x80000000; +pub const TT_IS_REDIRECT_MASK: ::libc::c_uint = 0xC0000000; +pub const TT_QUALIFIER_MASK: ::libc::c_uint = 0xFFFFFF00; pub type cef_transition_type_t = Enum_Unnamed12; pub type Enum_Unnamed13 = ::libc::c_uint; pub const UR_FLAG_NONE: ::libc::c_uint = 0;