-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
101 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
;; Note1: only macOS should need this | ||
;; Note2: create a closure that calls the stored callback (ensure it is thread-safe!) | ||
;; Note3: this thing can be realized with only using cffi? | ||
(c | ||
"#ifdef __APPLE__ | ||
#include <stdio.h> | ||
typedef void (*callback_t)(void); | ||
static callback_t stored_cb = NULL; | ||
void* closure_cffi_callback(void (*lisp_callback)(void)) { | ||
stored_cb = lisp_callback; | ||
return (^{ stored_cb(); }); | ||
} | ||
#else | ||
#include <stdio.h> | ||
void* closure_cffi_callback(void (*lisp_callback)(void)) { | ||
fprintf(stderr, \"Error(caten/byoc/helper/callback.lisp): Apple Blocks extension not supported on this platform.\n\"); | ||
return NULL; | ||
} | ||
#endif | ||
") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters