Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core-foundation-sys: Enable no_std environment #609

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core-foundation-sys/src/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use std::os::raw::c_void;
use core::ffi::c_void;

use base::{CFRange, CFIndex, CFAllocatorRef, CFTypeID, Boolean, CFComparatorFunction};
use string::CFStringRef;
Expand Down
2 changes: 1 addition & 1 deletion core-foundation-sys/src/attributed_string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use std::os::raw::c_void;
use core::ffi::c_void;
use base::{CFAllocatorRef, CFTypeRef, CFIndex, CFRange, CFTypeID, Boolean};
use string::CFStringRef;
use dictionary::CFDictionaryRef;
Expand Down
2 changes: 1 addition & 1 deletion core-foundation-sys/src/bag.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use std::os::raw::c_void;
use core::ffi::c_void;

use base::{CFAllocatorRef, Boolean, CFHashCode, CFIndex, CFTypeID};
use string::CFStringRef;
Expand Down
4 changes: 2 additions & 2 deletions core-foundation-sys/src/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use std::cmp::Ordering;
use std::os::raw::{c_uint, c_void, c_int, c_short, c_uchar, c_ushort};
use core::cmp::Ordering;
use core::ffi::{c_uint, c_void, c_int, c_short, c_uchar, c_ushort};
use string::CFStringRef;

pub type Boolean = u8;
Expand Down
2 changes: 1 addition & 1 deletion core-foundation-sys/src/binary_heap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use std::os::raw::c_void;
use core::ffi::c_void;

use base::{CFTypeID, CFAllocatorRef, Boolean, CFIndex, CFComparisonResult};
use string::CFStringRef;
Expand Down
2 changes: 1 addition & 1 deletion core-foundation-sys/src/bit_vector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use std::os::raw::c_void;
use core::ffi::c_void;

use base::{CFAllocatorRef, Boolean, UInt32, CFIndex, CFTypeID, CFRange, UInt8};

Expand Down
6 changes: 3 additions & 3 deletions core-foundation-sys/src/bundle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use std::os::raw::c_void;
use core::ffi::c_void;

use base::{CFTypeID, CFAllocatorRef, Boolean, CFTypeRef, UInt32, SInt32};
use std::os::raw::{c_uint, c_int};
use core::ffi::{c_uint, c_int};
use url::CFURLRef;
use dictionary::CFDictionaryRef;
use string::CFStringRef;
Expand All @@ -27,7 +27,7 @@ pub type CFBundleRefNum = c_int;
#[allow(unused)]
#[inline(always)]
pub unsafe fn CFCopyLocalizedString(key: CFStringRef, comment: CFStringRef) -> CFStringRef {
CFBundleCopyLocalizedString(CFBundleGetMainBundle(), key, key, std::ptr::null())
CFBundleCopyLocalizedString(CFBundleGetMainBundle(), key, key, core::ptr::null())
}
#[allow(unused)]
#[inline(always)]
Expand Down
2 changes: 1 addition & 1 deletion core-foundation-sys/src/calendar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use std::os::raw::{c_void, c_char};
use core::ffi::{c_void, c_char};

use base::{CFAllocatorRef, CFTypeID, Boolean, CFIndex, CFOptionFlags, CFRange};
use locale::{CFCalendarIdentifier, CFLocaleRef};
Expand Down
2 changes: 1 addition & 1 deletion core-foundation-sys/src/characterset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use std::os::raw::c_void;
use core::ffi::c_void;
use base::{Boolean, CFAllocatorRef, CFIndex, CFRange, CFTypeID, UTF32Char};
use data::CFDataRef;
use string::{CFStringRef, UniChar};
Expand Down
2 changes: 1 addition & 1 deletion core-foundation-sys/src/data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use std::os::raw::c_void;
use core::ffi::c_void;
use base::{CFAllocatorRef, CFTypeID, CFIndex, CFRange, CFOptionFlags};

#[repr(C)]
Expand Down
2 changes: 1 addition & 1 deletion core-foundation-sys/src/date.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use std::os::raw::c_void;
use core::ffi::c_void;

use base::{CFAllocatorRef, CFComparisonResult, CFTypeID};

Expand Down
2 changes: 1 addition & 1 deletion core-foundation-sys/src/date_formatter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use std::os::raw::c_void;
use core::ffi::c_void;

use base::{CFIndex, CFOptionFlags, CFAllocatorRef, CFTypeID, CFTypeRef, CFRange, Boolean};
use string::CFStringRef;
Expand Down
2 changes: 1 addition & 1 deletion core-foundation-sys/src/dictionary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use std::os::raw::c_void;
use core::ffi::c_void;

use base::{CFAllocatorRef, CFHashCode, CFIndex, CFTypeID, Boolean};
use string::CFStringRef;
Expand Down
2 changes: 1 addition & 1 deletion core-foundation-sys/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use std::os::raw::c_void;
use core::ffi::c_void;

use base::{CFTypeID, CFIndex, CFAllocatorRef};
use string::CFStringRef;
Expand Down
2 changes: 1 addition & 1 deletion core-foundation-sys/src/file_security.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use std::os::raw::c_void;
use core::ffi::c_void;

use base::{CFAllocatorRef, Boolean, CFTypeID};
#[cfg(feature="mac_os_10_8_features")]
Expand Down
2 changes: 1 addition & 1 deletion core-foundation-sys/src/filedescriptor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use std::os::raw::{c_int, c_void};
use core::ffi::{c_int, c_void};

use base::{Boolean, CFIndex, CFTypeID, CFOptionFlags, CFAllocatorRef};
use string::CFStringRef;
Expand Down
1 change: 1 addition & 0 deletions core-foundation-sys/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![no_std]
#![allow(non_snake_case, non_camel_case_types, non_upper_case_globals, improper_ctypes)]

#![cfg_attr(all(feature="mac_os_10_7_support", feature="mac_os_10_8_features"), feature(linkage))] // back-compat requires weak linkage
Expand Down
2 changes: 1 addition & 1 deletion core-foundation-sys/src/locale.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use std::os::raw::c_void;
use core::ffi::c_void;
use base::{CFIndex, CFAllocatorRef, CFTypeRef, LangCode, RegionCode, CFTypeID};
use array::CFArrayRef;
use string::CFStringRef;
Expand Down
2 changes: 1 addition & 1 deletion core-foundation-sys/src/mach_port.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use base::{CFAllocatorRef, CFIndex, CFTypeID, Boolean, mach_port_t};
use string::CFStringRef;
use runloop::CFRunLoopSourceRef;
use std::os::raw::c_void;
use core::ffi::c_void;

#[repr(C)]
pub struct __CFMachPort(c_void);
Expand Down
2 changes: 1 addition & 1 deletion core-foundation-sys/src/messageport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use std::os::raw::c_void;
use core::ffi::c_void;

use base::{CFAllocatorRef, CFIndex, CFTypeID, Boolean, SInt32};
use data::CFDataRef;
Expand Down
2 changes: 1 addition & 1 deletion core-foundation-sys/src/notification_center.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use std::os::raw::c_void;
use core::ffi::c_void;

use base::{CFOptionFlags, CFIndex, CFTypeID, Boolean};
use dictionary::CFDictionaryRef;
Expand Down
2 changes: 1 addition & 1 deletion core-foundation-sys/src/number.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use std::os::raw::c_void;
use core::ffi::c_void;

use base::{CFAllocatorRef, CFTypeID, CFComparisonResult, Boolean, CFIndex};

Expand Down
2 changes: 1 addition & 1 deletion core-foundation-sys/src/number_formatter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use std::os::raw::{c_void, c_double};
use core::ffi::{c_void, c_double};

use base::{CFIndex, CFOptionFlags, CFAllocatorRef, CFTypeID, CFRange, Boolean, CFTypeRef};
use string::CFStringRef;
Expand Down
2 changes: 1 addition & 1 deletion core-foundation-sys/src/plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use std::os::raw::c_void;
use core::ffi::c_void;

use base::{CFAllocatorRef, CFTypeID, Boolean, CFIndex};
use bundle::{CFPlugInRef, CFBundleRef};
Expand Down
2 changes: 1 addition & 1 deletion core-foundation-sys/src/runloop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use std::os::raw::c_void;
use core::ffi::c_void;

use array::CFArrayRef;
use base::{Boolean, CFIndex, CFTypeID, CFAllocatorRef, CFOptionFlags, CFHashCode, mach_port_t};
Expand Down
2 changes: 1 addition & 1 deletion core-foundation-sys/src/set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use std::os::raw::c_void;
use core::ffi::c_void;

use base::{CFAllocatorRef, CFIndex, CFTypeID, Boolean, CFHashCode};
use string::CFStringRef;
Expand Down
6 changes: 3 additions & 3 deletions core-foundation-sys/src/socket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use std::os::raw::c_void;
use core::ffi::c_void;

use base::{CFIndex, CFOptionFlags, SInt32, CFTypeID, CFAllocatorRef, UInt16, Boolean};
use data::CFDataRef;
Expand All @@ -25,9 +25,9 @@ pub type CFSocketError = CFIndex;
pub type CFSocketCallBackType = CFOptionFlags;
pub type CFSocketCallBack = extern "C" fn (s: CFSocketRef, _type: CFSocketCallBackType, address: CFDataRef, cdata: *const c_void, info: *mut c_void);
#[cfg(not(target_os = "windows"))]
pub type CFSocketNativeHandle = std::os::raw::c_int;
pub type CFSocketNativeHandle = core::ffi::c_int;
#[cfg(target_os = "windows")]
pub type CFSocketNativeHandle = std::os::raw::c_ulong;
pub type CFSocketNativeHandle = core::ffi::c_ulong;

pub const kCFSocketSuccess: CFSocketError = 0;
pub const kCFSocketError: CFSocketError = -1;
Expand Down
2 changes: 1 addition & 1 deletion core-foundation-sys/src/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use std::os::raw::{c_void, c_int};
use core::ffi::{c_void, c_int};

use base::{CFIndex, CFOptionFlags, SInt32, CFTypeID, CFAllocatorRef, UInt8, Boolean, CFTypeRef, UInt32};
use string::CFStringRef;
Expand Down
2 changes: 1 addition & 1 deletion core-foundation-sys/src/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use std::os::raw::{c_char, c_void, c_ulong, c_double, c_ushort};
use core::ffi::{c_char, c_void, c_ulong, c_double, c_ushort};
use base::{Boolean, CFOptionFlags, CFIndex, CFAllocatorRef, ConstStr255Param, CFRange, CFTypeID, SInt32, UInt32, UInt8, CFComparisonResult, StringPtr, ConstStringPtr, UTF32Char};
use array::CFArrayRef;
use data::CFDataRef;
Expand Down
2 changes: 1 addition & 1 deletion core-foundation-sys/src/string_tokenizer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use std::os::raw::c_void;
use core::ffi::c_void;

use base::{CFAllocatorRef, CFTypeID, CFRange, CFIndex, CFOptionFlags, CFTypeRef};
use string::CFStringRef;
Expand Down
2 changes: 1 addition & 1 deletion core-foundation-sys/src/timezone.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use std::os::raw::c_void;
use core::ffi::c_void;

use base::{CFAllocatorRef, CFTypeID, Boolean, CFIndex};
use date::{CFTimeInterval, CFAbsoluteTime};
Expand Down
2 changes: 1 addition & 1 deletion core-foundation-sys/src/tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use std::os::raw::c_void;
use core::ffi::c_void;

use base::{CFIndex, CFTypeID, CFAllocatorRef, CFComparatorFunction};
use string::CFStringRef;
Expand Down
2 changes: 1 addition & 1 deletion core-foundation-sys/src/url.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use std::os::raw::c_void;
use core::ffi::c_void;

use base::{CFOptionFlags, CFIndex, CFAllocatorRef, Boolean, CFTypeID, CFTypeRef, SInt32, CFRange};
use data::CFDataRef;
Expand Down
2 changes: 1 addition & 1 deletion core-foundation-sys/src/url_enumerator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use std::os::raw::c_void;
use core::ffi::c_void;

use base::{CFOptionFlags, CFIndex, CFTypeID, CFAllocatorRef, Boolean};
use url::CFURLRef;
Expand Down
2 changes: 1 addition & 1 deletion core-foundation-sys/src/user_notification.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use std::os::raw::c_void;
use core::ffi::c_void;

use base::{CFOptionFlags, CFIndex, CFAllocatorRef, CFTypeID, SInt32};
use dictionary::CFDictionaryRef;
Expand Down
2 changes: 1 addition & 1 deletion core-foundation-sys/src/uuid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use std::os::raw::c_void;
use core::ffi::c_void;

use base::{CFAllocatorRef, CFTypeID};
use string::CFStringRef;
Expand Down
2 changes: 1 addition & 1 deletion core-foundation-sys/src/xml_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use std::os::raw::{c_void, c_char};
use core::ffi::{c_void, c_char};

use base::{Boolean, CFIndex, CFAllocatorRef, CFTypeID};
use tree::CFTreeRef;
Expand Down
2 changes: 1 addition & 1 deletion core-foundation-sys/src/xml_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use std::os::raw::c_void;
use core::ffi::c_void;

use base::{CFOptionFlags, CFIndex, Boolean, CFAllocatorRef, CFTypeID};
use xml_node::{CFXMLNodeRef, CFXMLTreeRef, CFXMLExternalID};
Expand Down