r10811: fix warning for sbcl. remove setf getenv
[uffi.git] / src / os.lisp
index bcbf65839c0b5a6e39aaab9c0e87714d1c492cc1..c04497065dfa51e5cbd649c31a79c5c1bd84a191 100644 (file)
 
 (in-package #:uffi)
 
+
+(defun getenv (var)
+  "Return the value of the environment variable."
+  #+allegro (sys::getenv (string var))
+  #+clisp (sys::getenv (string var))
+  #+cmu (cdr (assoc (string var) ext:*environment-list* :test #'equalp
+                    :key #'string))
+  #+gcl (si:getenv (string var))
+  #+lispworks (lw:environment-variable (string var))
+  #+lucid (lcl:environment-variable (string var))
+  #+mcl (ccl::getenv var)
+  #+sbcl (sb-ext:posix-getenv var)
+  #-(or allegro clisp cmu gcl lispworks lucid mcl sbcl)
+  (error 'not-implemented :proc (list 'getenv var)))
+
+
 ;; modified from function ASDF -- Copyright Dan Barlow and Contributors
 
 (defun run-shell-command (control-string  &rest args &key output)