[swift-corelibs-dev] libdispatch module on Linux

Daniel Eggert danieleggert at me.com
Mon Jan 18 10:31:44 CST 2016


I’ve create a system module for libdispatch, but when I import it, I don’t see anything guarded by __BLOCKS__.

Is there something I need to do when defining the system module to make that work?

Or something when I use it?

/Daniel


% cat Package.swift 
import PackageDescription
let package = Package(name: "CDispatch”)


% cat module.modulemap 
module CDispatch [system] {
 umbrella header "/usr/local/include/dispatch/dispatch.h"
 link "dispatch"
 export *
}


% uname -a
Linux ubuntu 4.2.0-16-generic #19-Ubuntu SMP Thu Oct 8 15:35:06 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux



% swift -I path/to/CDispatch-1.0.2
Welcome to Swift version 2.2-dev (LLVM 3ebdbb2c7e, Clang f66c5bb67b, Swift 1f2908b4f7). Type :help for assistance.
 1> import CDispatch
 2> dispatch_group_
Available completions:
	dispatch_group_async_f(group: dispatch_group_t, queue: dispatch_queue_t, context: UnsafeMutablePointer<Void>, work: dispatch_function_t(UnsafeMutablePointer<Void>) -> Void) -> Void
	dispatch_group_create() -> dispatch_group_t
	dispatch_group_enter(group: dispatch_group_t) -> Void
	dispatch_group_leave(group: dispatch_group_t) -> Void
	dispatch_group_notify_f(group: dispatch_group_t, queue: dispatch_queue_t, context: UnsafeMutablePointer<Void>, work: dispatch_function_t(UnsafeMutablePointer<Void>) -> Void) -> Void
	dispatch_group_t
	dispatch_group_wait(group: dispatch_group_t, timeout: dispatch_time_t) -> Int



More information about the swift-corelibs-dev mailing list