;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING. If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; along with GNU Emacs; see the file COPYING. If not, write to
+;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
;; Boston, MA 02111-1307, USA.
;;; Commentary:
;; compiled regardless the environment (e.g. if an older CC Mode with
;; outdated macros are loaded during compilation). It also provides
;; features to defeat the compiler warnings for selected symbols.
+;;
+;; There's really nothing CC Mode specific here; this functionality
+;; ought to be provided by the byte compilers or some accompanying
+;; library.
\f
;;; Code:
"Bind the symbol as a function during compilation of the file,
to silence the byte compiler. Don't use within `eval-when-compile'."
`(eval-when-compile
- (if (not (assq ',fun cc-bytecomp-original-functions))
- (setq cc-bytecomp-original-functions
- (cons (list ',fun
- nil
- (if (fboundp ',fun)
- (symbol-function ',fun)
- 'unbound))
- cc-bytecomp-original-functions)))
- (if (and (cc-bytecomp-is-compiling)
- (= cc-bytecomp-load-depth 0)
- (not (fboundp ',fun)))
- (fset ',fun 'cc-bytecomp-ignore))))
+ (if (fboundp ',fun)
+ nil
+ (if (not (assq ',fun cc-bytecomp-original-functions))
+ (setq cc-bytecomp-original-functions
+ (cons (list ',fun nil 'unbound)
+ cc-bytecomp-original-functions)))
+ (if (and (cc-bytecomp-is-compiling)
+ (= cc-bytecomp-load-depth 0))
+ (fset ',fun 'cc-bytecomp-ignore)))))
(put 'cc-bytecomp-defmacro 'lisp-indent-function 'defun)
(defmacro cc-bytecomp-defmacro (fun &rest temp-macro)
Don't use within `eval-when-compile'."
`(eval-when-compile
(if (get ',symbol 'byte-obsolete-variable)
- (cc-bytecomp-put ',symbol 'byte-obsolete-variable nil))))
+ (cc-bytecomp-put ',symbol 'byte-obsolete-variable nil)
+ ;; This avoids a superfluous compiler warning
+ ;; about calling `get' for effect.
+ t)))
(defun cc-bytecomp-ignore-obsolete (form)
;; Wraps a call to `byte-compile-obsolete' that suppresses the warning.