]> code.delx.au - gnu-emacs/blobdiff - lisp/emacs-lisp/bytecomp.el
Merge from origin/emacs-25
[gnu-emacs] / lisp / emacs-lisp / bytecomp.el
index aa13210b633d669800b784c0fc780373f4d2492d..dc7574e778d45cd8bd684aeb563eaf146f1f2253 100644 (file)
@@ -2958,24 +2958,25 @@ for symbols generated by the byte compiler itself."
         (list body))))
 
 ;; Special macro-expander used during byte-compilation.
-(defun byte-compile-macroexpand-declare-function (fn file &optional arglist
-                                                     fileonly)
-  (let ((gotargs (listp arglist))
+(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 arglist nil)
+         (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 arglist)
+                      (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.
-  (macroexpand `(declare-function ,fn ,file ,arglist ,fileonly)))
+  (macroexpand `(declare-function ,fn ,file ,@args)))
 
 \f
 ;; This is the recursive entry point for compiling each subform of an