From: shuhei Date: Tue, 30 Nov 1999 21:01:16 +0000 (+0000) Subject: (emacs-major-version, emacs-minor-version): Define at compile-time X-Git-Tag: apel-shubit-10_0~16 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=cde23a12aafa7ec93033c7438d3203a090941faa;p=elisp%2Fapel.git (emacs-major-version, emacs-minor-version): Define at compile-time as well as at load-time in order to do compile-time version check. (tcp): Require if `open-network-stream' is not available; moved from "pces.el". --- diff --git a/poe.el b/poe.el index 39a549a..ef09ad1 100644 --- a/poe.el +++ b/poe.el @@ -35,21 +35,26 @@ ;;; @ Version information. ;;; -(defconst-maybe emacs-major-version - (progn (string-match "^[0-9]+" emacs-version) - (string-to-int (substring emacs-version - (match-beginning 0)(match-end 0)))) - "Major version number of this version of Emacs.") - -(defconst-maybe emacs-minor-version - (progn (string-match "^[0-9]+\\.\\([0-9]+\\)" emacs-version) - (string-to-int (substring emacs-version - (match-beginning 1)(match-end 1)))) - "Minor version number of this version of Emacs.") - -(static-when (= emacs-major-version 18) +;; v18 does not have many features we expect, +;; notably `eval-when-compile' and `eval-and-compile'. +(static-when (string= (substring emacs-version 0 2) "18") (require 'poe-18)) +;; Now we can use them! +(eval-and-compile + ;; We must define these two constants at compile-time as well as + ;; load-time since they are used for compile-time version checking. + (defconst-maybe emacs-major-version + (progn (string-match "^[0-9]+" emacs-version) + (string-to-int (substring emacs-version + (match-beginning 0)(match-end 0)))) + "Major version number of this version of Emacs.") + (defconst-maybe emacs-minor-version + (progn (string-match "^[0-9]+\\.\\([0-9]+\\)" emacs-version) + (string-to-int (substring emacs-version + (match-beginning 1)(match-end 1)))) + "Minor version number of this version of Emacs.")) + ;; Some ancient version of XEmacs did not provide 'xemacs. (static-when (string-match "XEmacs" emacs-version) (provide 'xemacs)) @@ -64,6 +69,10 @@ (static-when (featurep 'xemacs) (require 'poe-xemacs)) + +;; must be load-time check to share .elc between different systems. +(or (fboundp 'open-network-stream) + (require 'tcp)) ;;; @ C primitives emulation.