   []
   (let [libs (get {"win"   ["msvcr100" "msvcp100" "libzmq" "jzmq"]
                    "linux" ["libzmq" "libjzmq"]
-                   "mac"   ["libzmq.dylib" "libjzmq.dylib"]}
+                   "mac"   ["zmq" "jzmq"]}
                   (os))]
     (doseq [l libs] (load-library l))))
 

      (throw (UnsupportedOperationException.
               (str "Unsupported platform: " os-name ", " os-arch))))))

(defn- save-library
  [lib-name]
  (let [lib-path (str "native/" (arch) "/" (os) "/" lib-name)
        tmp-dir  (io/file (str (System/getProperty "java.io.tmpdir")
                            "/naughtmq/"
                            (-> lib-path io/resource io/input-stream p/sha1)
                            "/"))
        tmp-path (-> (str tmp-dir "/" lib-name) io/file)]
    (if (not (.exists tmp-dir)) (.mkdirs tmp-dir))
    (if (not (.exists tmp-path))
      (with-open [in  (-> lib-path io/resource io/input-stream)

  (:import [naughtmq PrivateLoader]
           [org.zeromq EmbeddedLibraryTools]
           [java.lang.reflect Field Modifier]))

(def version-for
  {"jzmq" "2.2.2"
   "zmq"  "4.0.4"})

(defn- os
  "Returns a string representing the current operating system, one of win,
