Skip to content

Commit

Permalink
Merge pull request #2 from pocket7878/change-magic-header-place
Browse files Browse the repository at this point in the history
Support multiple magic.h header place.
  • Loading branch information
dochang committed Apr 6, 2015
2 parents 902b262 + e79db91 commit ec33225
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
10 changes: 10 additions & 0 deletions cffi-grovel-patch.lisp
@@ -1,5 +1,15 @@
(in-package :cffi-grovel)

(define-grovel-syntax include-or (&rest file-names)
(loop
for file-name in file-names
if (probe-file file-name)
do
(return
(format out "#include <~A>~%" file-name))))

(push 'include-or *header-forms*)

;; Defines a bitfield, with elements specified as ((lisp-name c-name)
;; &key documentation). name-and-opts can be either a symbol as name,
;; or a list (name &key base-type).
Expand Down
3 changes: 2 additions & 1 deletion grovel.lisp
@@ -1,6 +1,7 @@
(in-package :magicffi)

(include "/usr/include/magic.h")
(include-or "/usr/include/magic.h"
"/usr/local/include/magic.h")

(progn
(constant (+MAGIC-NONE+ "MAGIC_NONE")
Expand Down

0 comments on commit ec33225

Please sign in to comment.