summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorTimothee Cour <timothee.cour2@gmail.com>2020-02-04 05:08:56 -0800
committerGitHub <noreply@github.com>2020-02-04 14:08:56 +0100
commite70294dff2e0393d36a6ae64efb018f3fb5ae2a5 (patch)
tree9e47fee0729874e186d00b53d5e584c3040bf469 /compiler
parentb20d7e2110d3d8ab406d44f2231120847e6fea05 (diff)
downloadNim-e70294dff2e0393d36a6ae64efb018f3fb5ae2a5.tar.gz
enable testing -d:nimHasLibFFI mode (#13091)
Diffstat (limited to 'compiler')
-rw-r--r--compiler/condsyms.nim6
-rw-r--r--compiler/evalffi.nim2
2 files changed, 8 insertions, 0 deletions
diff --git a/compiler/condsyms.nim b/compiler/condsyms.nim
index ec9b4a9f4..9a762d585 100644
--- a/compiler/condsyms.nim
+++ b/compiler/condsyms.nim
@@ -103,3 +103,9 @@ proc initDefines*(symbols: StringTableRef) =
   defineSymbol("nimNewShiftOps")
   defineSymbol("nimHasCursor")
   defineSymbol("nimHasExceptionsQuery")
+
+  when defined(nimHasLibFFI):
+    # Renaming as we can't conflate input vs output define flags; e.g. this
+    # will report the right thing regardless of whether user adds
+    # `-d:nimHasLibFFI` in his user config.
+    defineSymbol("nimHasLibFFIEnabled")
diff --git a/compiler/evalffi.nim b/compiler/evalffi.nim
index 58b996e60..58c505a5b 100644
--- a/compiler/evalffi.nim
+++ b/compiler/evalffi.nim
@@ -17,6 +17,8 @@ when defined(windows):
   const libcDll = "msvcrt.dll"
 elif defined(linux):
   const libcDll = "libc.so(.6|.5|)"
+elif defined(bsd):
+  const libcDll = "/lib/libc.so.7"
 elif defined(osx):
   const libcDll = "/usr/lib/libSystem.dylib"
 else: