summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2012-12-19 21:45:18 +0100
committerAraq <rumpf_a@web.de>2012-12-19 21:45:18 +0100
commitb6c8e16b0f23b09fc4c35e3c2542b75c32152e62 (patch)
tree9dd6e9b6d26f524dbfebdb25d839d00b299574cd
parentc73d9fdd4c5d216b75ae4dc7659ea6c19c13ad15 (diff)
downloadNim-b6c8e16b0f23b09fc4c35e3c2542b75c32152e62.tar.gz
bugfix: openssl import for macosx
-rwxr-xr-xcompiler/condsyms.nim2
-rw-r--r--compiler/evalffi.nim3
-rwxr-xr-xcompiler/main.nim3
-rwxr-xr-xlib/wrappers/openssl.nim10
4 files changed, 11 insertions, 7 deletions
diff --git a/compiler/condsyms.nim b/compiler/condsyms.nim
index 4cac7c847..17366f6e9 100755
--- a/compiler/condsyms.nim
+++ b/compiler/condsyms.nim
@@ -61,8 +61,6 @@ proc InitDefines*() =
   DefineSymbol("nimmixin")
   DefineSymbol("nimeffects")
   DefineSymbol("nimbabel")
-  when defined(useFFI):
-    DefineSymbol("nimffi")
   
   # add platform specific symbols:
   case targetCPU
diff --git a/compiler/evalffi.nim b/compiler/evalffi.nim
index 35659ed26..464c932f9 100644
--- a/compiler/evalffi.nim
+++ b/compiler/evalffi.nim
@@ -33,6 +33,9 @@ proc getDll(cache: var TDllCache; dll: string): pointer =
       InternalError("cannot load: " & dll)
     cache[dll] = result
 
+const
+  nkPtrLit = nkIntLit # hopefully we can get rid of this hack soon
+
 proc importcSymbol*(sym: PSym): PNode =
   let name = ropeToStr(sym.loc.r)
   
diff --git a/compiler/main.nim b/compiler/main.nim
index edd4fda68..a65660380 100755
--- a/compiler/main.nim
+++ b/compiler/main.nim
@@ -157,6 +157,9 @@ proc CommandInteractive =
   #setTarget(osNimrodVM, cpuNimrodVM)
   initDefines()
   DefineSymbol("nimrodvm")
+  when hasFFI:
+    DefineSymbol("nimffi")
+
   registerPass(verbosePass())
   registerPass(sem.semPass())
   registerPass(evals.evalPass()) # load system module:
diff --git a/lib/wrappers/openssl.nim b/lib/wrappers/openssl.nim
index 752e594d1..f692db13a 100755
--- a/lib/wrappers/openssl.nim
+++ b/lib/wrappers/openssl.nim
@@ -48,14 +48,14 @@ when defined(WINDOWS):
 else:
   const
     versions = "(|.1.0.0|.0.9.9|.0.9.8|.0.9.7|.0.9.6|.0.9.5|.0.9.4)"
-  when defined(posix):
-    const 
-      DLLSSLName = "libssl.so" & versions
-      DLLUtilName = "libcrypto.so" & versions
-  else: 
+  when defined(macosx):
     const 
       DLLSSLName = "libssl.dylib" & versions
       DLLUtilName = "libcrypto.dylib" & versions
+  else:
+    const 
+      DLLSSLName = "libssl.so" & versions
+      DLLUtilName = "libcrypto.so" & versions
 
 type 
   SslStruct {.final, pure.} = object