Function: byte-compile-macroexpand-declare-function

byte-compile-macroexpand-declare-function is a byte-compiled function defined in bytecomp.el.gz.

Signature

(byte-compile-macroexpand-declare-function FN FILE &optional ARGLIST FILEONLY)

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/bytecomp.el.gz
;; Special macro-expander used during byte-compilation.
(defun byte-compile-macroexpand-declare-function (fn file &rest args)
  (declare (advertised-calling-convention
	    (fn file &optional arglist fileonly) nil))
  (let ((gotargs (and (consp args) (listp (car args))))
	(unresolved (assq fn byte-compile-unresolved-functions)))
    (when unresolved	      ; function was called before declaration
      (if (and gotargs (byte-compile-warning-enabled-p 'callargs))
	  (byte-compile-arglist-warn fn (car args) nil)
	(setq byte-compile-unresolved-functions
	      (delq unresolved byte-compile-unresolved-functions))))
    (push (cons fn (if gotargs
		       (list 'declared (car args))
		     t))                     ; Arglist not specified.
	  byte-compile-function-environment))
  ;; We are stating that it _will_ be defined at runtime.
  (setq byte-compile-noruntime-functions
        (delq fn byte-compile-noruntime-functions))
  ;; Delegate the rest to the normal macro definition.
  (let ((print-symbols-bare t))         ; Possibly redundant binding.
    (macroexpand `(declare-function ,fn ,file ,@args))))