Skip to content
This repository has been archived by the owner on Jun 28, 2022. It is now read-only.

Add helper for creating CharSlice from a string literal #36

Merged
merged 4 commits into from
Mar 21, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions ddprof-ffi/cbindgen.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ style = "both"
no_includes = true
sys_includes = ["stdbool.h", "stddef.h", "stdint.h"]

after_includes = """

#define DDPROF_FFI_CHARSLICE_C(string) \\
/* NOTE: Compilation fails if you pass in a char* instead of a literal */ ((ddprof_ffi_CharSlice) {.ptr = "" string, .len = sizeof(string) - 1})"""

[export]
prefix = "ddprof_ffi_"

Expand Down