From: shuhei Date: Sun, 18 Mar 2001 12:24:53 +0000 (+0000) Subject: Removed hack for compiler. X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=8e251dede33dd32d5f2801ea35e43a8aceb0cfcc;p=elisp%2Fflim.git Removed hack for compiler. Use `sha1-dl-module' for test whether to require 'sha1-dl. (sha1-encode, sha1-encode-binary): Removed compatibility code for another sha1.el since it was broken. Update Copyright header. --- diff --git a/sha1.el b/sha1.el index 0e3b7ac..a9e5e9d 100644 --- a/sha1.el +++ b/sha1.el @@ -3,8 +3,6 @@ ;; Copyright (C) 1999, 2001 Free Software Foundation, Inc. ;; Author: Shuhei KOBAYASHI -;; Kenichi OKADA -;; Maintainer: Kenichi OKADA ;; Keywords: SHA1, FIPS 180-1 ;; This file is part of FLIM (Faithful Library about Internet Message). @@ -40,39 +38,27 @@ ;;; Code: -(require 'hex-util) - -(eval-when-compile - (or (fboundp 'sha1-string) - (defun sha1-string (a)))) - (defvar sha1-dl-module - (if (and (fboundp 'sha1-string) - (subrp (symbol-function 'sha1-string))) - nil - (if (fboundp 'dynamic-link) - (let ((path (expand-file-name "sha1.so" exec-directory))) - (and (file-exists-p path) - path))))) + (cond + ((and (fboundp 'sha1) + (subrp (symbol-function 'sha1))) + nil) + ((fboundp 'dynamic-link) + ;; Should we take care of `dynamic-link-path'? + (let ((path (expand-file-name "sha1.so" exec-directory))) + (if (file-exists-p path) + path + nil))) + (t + nil))) (cond - (sha1-dl-module - ;; Emacs with DL patch. + ((and (stringp sha1-dl-module) + (file-exists-p sha1-dl-module)) (require 'sha1-dl)) (t (require 'sha1-el))) -;; compatibility for another sha1.el by Keiichi Suzuki. -(defun sha1-encode (string) - (decode-hex-string - (sha1-string string))) -(defun sha1-encode-binary (string) - (decode-hex-string - (sha1-string string))) - -(make-obsolete 'sha1-encode "It's old API.") -(make-obsolete 'sha1-encode-binary "It's old API.") - (provide 'sha1) ;;; sha1.el ends here