summary refs log tree commit diff stats
path: root/lib/system/dyncalls.nim
diff options
context:
space:
mode:
authorAdam Strzelecki <ono@java.pl>2015-10-22 20:40:02 +0200
committerAdam Strzelecki <ono@java.pl>2015-10-22 20:40:02 +0200
commita02359b4e1e25ec69df08f67a6698fb292de49f2 (patch)
tree75f56981ad918120cd0aecc49126660840c5e3ad /lib/system/dyncalls.nim
parenta90e23a4ddbef38cdf48c59e68630999c6e90374 (diff)
downloadNim-a02359b4e1e25ec69df08f67a6698fb292de49f2.tar.gz
system/dyncalls: OS X is already handled as posix
So elif defined(mac) has absolutely no effect, also this block uses some legacy
discouraged NSCreateObjectFileImageFromFile function.
Diffstat (limited to 'lib/system/dyncalls.nim')
-rw-r--r--lib/system/dyncalls.nim36
1 files changed, 0 insertions, 36 deletions
diff --git a/lib/system/dyncalls.nim b/lib/system/dyncalls.nim
index fe98b1e6f..908aa551b 100644
--- a/lib/system/dyncalls.nim
+++ b/lib/system/dyncalls.nim
@@ -107,42 +107,6 @@ elif defined(windows) or defined(dos):
     result = getProcAddress(cast[THINSTANCE](lib), name)
     if result == nil: procAddrError(name)
 
-elif defined(mac):
-  #
-  # =======================================================================
-  # Native Mac OS X / Darwin Implementation
-  # =======================================================================
-  #
-  {.error: "no implementation for dyncalls yet".}
-
-  proc nimUnloadLibrary(lib: LibHandle) =
-    NSUnLinkModule(NSModule(lib), NSUNLINKMODULE_OPTION_RESET_LAZY_REFERENCES)
-
-  var
-    dyld_present {.importc: "_dyld_present", header: "<dyld.h>".}: int
-
-  proc nimLoadLibrary(path: string): LibHandle =
-    var
-      img: NSObjectFileImage
-      ret: NSObjectFileImageReturnCode
-      modul: NSModule
-    # this would be a rare case, but prevents crashing if it happens
-    result = nil
-    if dyld_present != 0:
-      ret = NSCreateObjectFileImageFromFile(path, addr(img))
-      if ret == NSObjectFileImageSuccess:
-        modul = NSLinkModule(img, path, NSLINKMODULE_OPTION_PRIVATE or
-                                        NSLINKMODULE_OPTION_RETURN_ON_ERROR)
-        NSDestroyObjectFileImage(img)
-        result = LibHandle(modul)
-
-  proc nimGetProcAddr(lib: LibHandle, name: cstring): ProcAddr =
-    var
-      nss: NSSymbol
-    nss = NSLookupSymbolInModule(NSModule(lib), name)
-    result = ProcAddr(NSAddressOfSymbol(nss))
-    if result == nil: ProcAddrError(name)
-
 else:
   {.error: "no implementation for dyncalls".}