Skip to content

shotastage/LibC.swift

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LibC.swift

Build Status Swift 5 MIT License

Import Glibc or Darwin library automatically.

Usage

Please add "SwiftLibC" to Package.swift using Swift Package Manager(SPM).

import PackageDescription
let package = Package(
    name: "Package Name",
    dependences: [
    	.package(url: "https://github.com/shotastage/SwiftCLibrary.git", from: "1.0.0"),
    ]
)

You can import LibC like following code.

import clib

and You can use this library only add import clib to first line of source. You need not to write codes like following.

#if os(OSX)
	import Darwin
#elseif os(Linux)
	import Glibc
#endif

License

This program is freely distributed under the MIT, see LICENSE for detail.