Clozure already provides a getenv function.

Trying to provide a new one fails with an error, that I missed because I
must have forgotten to `make clean` when adding the previous #+ccl
variant here...

This alone doesn't allow to fix building for CCL but already improves
the situation as reported at #303. Next failure is something I fail to
understand tonight:

  Fatal SIMPLE-ERROR:
  Compilation failed: In MAKE-DOUBLE-FLOAT: Type declarations violated in (THE FIXNUM 4294967295) in /Users/dim/dev/pgloader/build/quicklisp/local-projects/qmynd/src/common/utilities.lisp
This commit is contained in:
Dimitri Fontaine 2015-11-08 18:26:58 +01:00
parent 3673c5c341
commit 042045c0a6

View File

@ -8,9 +8,11 @@
(in-package :cl-user)
;;
;; ccl provides an implementation of getenv already.
;;
#+sbcl
(defun getenv (name &optional default)
"Return the current value for the environment variable NAME, or default
when unset."
(or #+sbcl (sb-ext:posix-getenv name)
#+ccl (ccl:getenv name)
default))
(or (sb-ext:posix-getenv name) default))