forked from touchlab/Kermit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replacing usage of private API with public API, by switching to cInte…
…rop. Fixes issue touchlab#339
- Loading branch information
1 parent
96281ab
commit 7636aef
Showing
4 changed files
with
37 additions
and
16 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
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,21 @@ | ||
package = co.touchlab.kermit.darwin | ||
--- | ||
|
||
#include <os/log.h> | ||
|
||
/** | ||
* Passing `os_log_t` between this file and a normal kotlin file isn't working correctly. | ||
* There's a weird type mismatch: | ||
* - from here: os_log_t = CPointer<os_log_s> | ||
* - normal kotlin: os_log_t = NSObject? | ||
* For now we're just avoiding the issue by using a generic pointer. | ||
*/ | ||
typedef void* darwin_os_log_t; | ||
|
||
darwin_os_log_t darwin_log_create(const char *subsystem, const char *category) { | ||
return os_log_create(subsystem, category); | ||
} | ||
|
||
void darwin_log_with_type(darwin_os_log_t log, os_log_type_t type, const char *msg) { | ||
os_log_with_type((os_log_t)log, type, "%s", msg); | ||
} |