Check for the existence of hash functions instead of the Emacs version to
[gnus] / lisp / spam-stat.el
index e348c2a..0a0fcf9 100644 (file)
@@ -180,11 +180,12 @@ This is set by hooking into Gnus.")
 
 ;; Functions missing in Emacs 20
 
-(eval-and-compile
-  (when (and (not (featurep 'xemacs))
-            (= emacs-major-version 20))
-    ;; gethash, hash-table-count, make-hash-table, mapc
-    (require 'cl)
+(when (memq nil (mapcar 'fboundp
+                       '(gethash hash-table-count make-hash-table
+                                 mapc puthash)))
+  (require 'cl)
+  (unless (fboundp 'puthash)
+    ;; alias puthash is missing from Emacs 20 cl-extra.el
     (defalias 'puthash 'cl-puthash)))
 
 (eval-when-compile