Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
4942896241 | |||
a263017504 | |||
75e98123df | |||
346c7190ec |
@@ -5,7 +5,7 @@ is a simple module for defining C code inside Carp code.
|
||||
## Installation
|
||||
|
||||
```clojure
|
||||
(load "https://veitheller.de/git/carpentry/inline-c@0.0.1")
|
||||
(load "https://veitheller.de/git/carpentry/inline-c@0.0.3")
|
||||
```
|
||||
|
||||
## Usage
|
||||
@@ -16,7 +16,7 @@ express those things that are just kind of awkward in Carp (like complex
|
||||
bit-twiddling) without having to include a helper every time.
|
||||
|
||||
```clojure
|
||||
(load "https://veitheller.de/git/carpentry/inline-c@0.0.1")
|
||||
(load "https://veitheller.de/git/carpentry/inline-c@0.0.3")
|
||||
|
||||
(inline-c "int count_set_bits(int n) {
|
||||
int count = 0;
|
||||
|
@@ -1,9 +1,9 @@
|
||||
(defdynamic *c-counter* 0)
|
||||
|
||||
(defndynamic inline-c [s]
|
||||
(let [f (String.join [(Project.get-config "output-directory")
|
||||
"carp_inline_c_generated" (str *c-counter*) ".h"])]
|
||||
(let [f (String.concat [(Project.get-config "output-directory")
|
||||
"carp_inline_c_generated" (str *c-counter*) ".h"])]
|
||||
(do
|
||||
(write-file f s)
|
||||
(defdynamic *c-counter* (inc *c-counter*))
|
||||
(set! *c-counter* (inc *c-counter*))
|
||||
(system-include f))))
|
||||
|
Reference in New Issue
Block a user