Skip to content

Commit

Permalink
Yet more fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
troughton committed Apr 15, 2016
1 parent 747ca2b commit 5ea1429
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Sources/SwiftGL.swift
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class CommandInfo : CustomStringConvertible {
}

@noreturn
private func buildError(info: CommandInfo) -> String {
private func buildError(_ info: CommandInfo) -> String {
var adds = ""
var rems = ""
var exts = ""
Expand Down Expand Up @@ -120,7 +120,7 @@ private func buildError(info: CommandInfo) -> String {
func getAddress(info: CommandInfo) -> UnsafeMutablePointer<Void> {
let fp = lookupAddress(info)
if (fp == nil) {buildError(info)}
return fp
return fp!
}

// Platform specific sections below.
Expand All @@ -131,9 +131,9 @@ func getAddress(info: CommandInfo) -> UnsafeMutablePointer<Void> {
import Darwin

let openGLframework = "/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL"
var dlopenHandle : UnsafeMutablePointer<Void> = nil
var dlopenHandle : UnsafeMutablePointer<Void>? = nil

func lookupAddress(info: CommandInfo) -> UnsafeMutablePointer<Void> {
func lookupAddress(_ info: CommandInfo) -> UnsafeMutablePointer<Void>? {
if dlopenHandle == nil {
dlopenHandle = dlopen(openGLframework, RTLD_LAZY)
}
Expand All @@ -147,10 +147,10 @@ func getAddress(info: CommandInfo) -> UnsafeMutablePointer<Void> {

import Glibc

var dlopenHandle = UnsafeMutablePointer<Void>()
var dlopenHandle : UnsafeMutablePointer<Void>? = nil
var glXGetProcAddress:(@convention(c) (UnsafePointer<GLchar>) -> UnsafeMutablePointer<Void>)? = nil

func lookupAddress(info: CommandInfo) -> UnsafeMutablePointer<Void> {
func lookupAddress(_ info: CommandInfo) -> UnsafeMutablePointer<Void>? {
if dlopenHandle == nil {
dlopenHandle = dlopen(nil, RTLD_LAZY | RTLD_LOCAL)
}
Expand All @@ -177,7 +177,7 @@ func getAddress(info: CommandInfo) -> UnsafeMutablePointer<Void> {

#else

func lookupAddress(info: commandInfo) -> UnsafeMutablePointer<Void> {
func lookupAddress(_ info: commandInfo) -> UnsafeMutablePointer<Void> {
fatalError("Unsupported OS")
}

Expand Down

0 comments on commit 5ea1429

Please sign in to comment.