Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce
DDOG_CHARSLICE_C_BARE
and undo change to `DDOG_CHARSLICE_…
…C` helper **What does this PR do?** This PR introduces a new `DDOG_CHARSLICE_C_BARE` helper, as well as undoes the change to `DDOG_CHARSLICE_C` from https://github.com/DataDog/libdatadog/pull/305/files#diff-5c00b9c49c81bf0d0a754e0bcc6e0add4fe849bf0ea4a4d1ebfac8f698150f0b There are now two helpers: `DDOG_CHARSLICE_C` that includes the `(ddog_CharSlice)` cast and `DDOG_CHARSLICE_C_BARE` which doesn't. **Motivation:** In a nutshell @bwoebi explained to me that on Windows there's times where you need to use `(ddog_CharSlice) {.ptr = ..., .len = ...}` and others where you need to use `{.ptr = ..., .len = ...}` and cannot include the cast. Thus in #305 we tweaked the helper to never have `(ddog_CharSlice)`, with the intention of using `(ddog_CharSlice) DDOG_CHARSLICE_C(...)` some times, and `DDOG_CHARSLICE_C(...)` the other times. But... this had the downside of making some of our Ruby Profiler code really ugly, as we'd need to move from `DDOG_CHARSLICE_C` to `(CharSlice) DDOG_CHARSLICE_C` in a lot of cases. Thus, this PR introduces one helper for each variant, so that we always have a nice user-friendly option for each case, and avoid needing to sprinkle casts. **Additional Notes:** Arghhh C/C++ you always manage to be weird and annoying. **How to test the change?** I've tested this change by compiling the Ruby profiler to use this branch of libdatadog, and validating that it compiles successfully on Linux.
- Loading branch information