anchor.diff:  
       let unsupPlatform () = raise (PlatformNotSupportedException "NativeLib does not support this platform.")
   
  -    module private Unix =
  +    module private Linux =
   
           let RTLD_LAZY = nativeint 1
           let RTLD_NOW = nativeint 2
   
  -        [<DllImport("dl")>]
  +        [<DllImport("libdl.so.2")>]
           extern IntPtr dlopen (string filename, nativeint flags)
   
  -        [<DllImport("dl")>]
  +        [<DllImport("libdl.so.2")>]
           extern nativeint dlclose (IntPtr handle)
   
  -        [<DllImport("dl")>]
  +        [<DllImport("libdl.so.2")>]
           extern IntPtr dlsym (IntPtr handle, string symbol)
   
  -        [<DllImport("dl")>]
  +        [<DllImport("libdl.so.2")>]
           extern IntPtr dlerror ()
   
           let dlerrorString () =
               dlerror () |> Marshal.PtrToStringAnsi 
   
  +    module private Mac =
  +
  +        let RTLD_LAZY = nativeint 1
  +        let RTLD_NOW = nativeint 2
  +
  +        [<DllImport("dl")>]
  +        extern IntPtr dlopen (string filename, nativeint flags)
  +
  +        [<DllImport("dl")>]
  +        extern nativeint dlclose (IntPtr handle)
  +
  +        [<DllImport("dl")>]
  +        extern IntPtr dlsym (IntPtr handle, string symbol)
  +
  +        [<DllImport("dl")>]
  +        extern IntPtr dlerror ()
  +
  +        let dlerrorString () =
  +            dlerror () |> Marshal.PtrToStringAnsi             
  +
       module private Windows =
   
           [<DllImport("kernel32", SetLastError=true)>]
  
positive.code:         extern IntPtr GetProcAddress (IntPtr hModule, string procName)   
  
      let load (filename: string) =
          if RuntimeInformation.IsOSPlatform OSPlatform.Linux || RuntimeInformation.IsOSPlatform OSPlatform.OSX then
              let hnd = Unix.dlopen (filename, Unix.RTLD_NOW)
              if hnd <> IntPtr.Zero then Ok hnd
              else Error (Unix.dlerrorString ())
          elif RuntimeInformation.IsOSPlatform OSPlatform.Windows then
              let hnd = Windows.LoadLibraryEx (filename, IntPtr.Zero, nativeint 0)
              if hnd <> IntPtr.Zero then Ok hnd
  
negative.code:             unsupPlatform ()
  
      let free (hnd: IntPtr) =
          if RuntimeInformation.IsOSPlatform OSPlatform.Linux then
              Linux.dlclose (hnd) |> ignore
          elif RuntimeInformation.IsOSPlatform OSPlatform.OSX then
              Mac.dlclose (hnd) |> ignore            
          elif RuntimeInformation.IsOSPlatform OSPlatform.Windows then
              Windows.FreeLibrary (hnd) |> ignore
          else
              unsupPlatform ()
          
      let getAddress (hnd: IntPtr) (name: string) =
          if RuntimeInformation.IsOSPlatform OSPlatform.Linux then
              let ptr = Linux.dlsym (hnd, name)
              if ptr <> IntPtr.Zero then Ok ptr
              else Error (Linux.dlerrorString ())       
          elif RuntimeInformation.IsOSPlatform OSPlatform.OSX then
              let ptr = Mac.dlsym (hnd, name)
              if ptr <> IntPtr.Zero then Ok ptr
              else Error (Mac.dlerrorString ())                   
          elif RuntimeInformation.IsOSPlatform OSPlatform.Windows then
              let ptr = Windows.GetProcAddress (hnd, name)
              if ptr <> IntPtr.Zero then Ok ptr
  