freaky feature test added by rivo on Thu Aug 1 19:50:07 2013

;; *.setup file

; force chicken to produce preprocessor output instead of object file
(compile -c -C -E ft.scm)

; ft.o now contains preprocessor output with expanded define directives
; comment all noisy lines only register-feature! will survive
(patch '("ft.o" "features.scm") "^(?!\\(register-feature!|\\(unregister-feature!).*" "")

;; ft.scm file


(define-syntax declare-foreign-feature
  (er-macro-transformer
   (lambda (e r c)
     (let ((d (->string (cadr e)))
           (dp "HAVE_"))
       `(,(r 'foreign-declare)
         ,(sprintf "#ifdef ~A\n(register-feature! ~A~A)\n#else\n(unregister-feature! ~A~A)\n#endif\n"
                   d dp d dp d))))))

(declare-foreign-feature _WIN32)