(defsubst company-clang-version ()
"Return the version of `company-clang-executable'."
(with-temp-buffer
(call-process company-clang-executable nil t nil "--version")
(goto-char (point-min))
(defsubst company-clang-version ()
"Return the version of `company-clang-executable'."
(with-temp-buffer
(call-process company-clang-executable nil t nil "--version")
(goto-char (point-min))
- (if (re-search-forward "clang version \\([0-9.]+\\)" nil t)
- (match-string-no-properties 1)
- "0")))
+ (if (re-search-forward "clang\\(?: version \\|-\\)\\([0-9.]+\\)" nil t)
+ (let ((ver (string-to-number (match-string-no-properties 1))))
+ (if (> ver 100)
+ (/ ver 100)
+ ver))
+ 0)))
(interactive (company-begin-backend 'company-clang))
(init (unless company-clang-executable
(error "Company found no clang executable"))
(interactive (company-begin-backend 'company-clang))
(init (unless company-clang-executable
(error "Company found no clang executable"))