MaulingMonkey / thindx-xaudio2

Rust bindings for XAudio2
Other
1 stars 0 forks source link

Validate ABI types against C++ header parsing? #6

Open MaulingMonkey opened 2 years ago

MaulingMonkey commented 2 years ago

Hand validated a bunch:

static_assert(sizeof(XAUDIO2_SEND_DESCRIPTOR) == 4 + 8);
static_assert(alignof(XAUDIO2_SEND_DESCRIPTOR) == 1);

static_assert(sizeof(XAUDIO2_VOICE_SENDS) == 4 + 8);
static_assert(alignof(XAUDIO2_VOICE_SENDS) == 1);

static_assert(sizeof(XAUDIO2_EFFECT_DESCRIPTOR) == 8 + 4 + 4);
static_assert(alignof(XAUDIO2_EFFECT_DESCRIPTOR) == 1);

static_assert(sizeof(XAUDIO2_EFFECT_CHAIN) == 4 + 8);
static_assert(alignof(XAUDIO2_EFFECT_CHAIN) == 1);

static_assert(sizeof(XAUDIO2_FILTER_PARAMETERS) == 4 + 4 + 4);
static_assert(alignof(XAUDIO2_FILTER_PARAMETERS) == 1);

static_assert(sizeof(XAUDIO2_BUFFER) == 4 + 4 + 8 + 4 + 4 + 4 + 4 + 4 + 8);
static_assert(alignof(XAUDIO2_BUFFER) == 1);

static_assert(sizeof(XAUDIO2_BUFFER_WMA) == 8 + 4);
static_assert(alignof(XAUDIO2_BUFFER_WMA) == 1);

static_assert(sizeof(XAUDIO2_VOICE_STATE) == 8 + 4 + 8);
static_assert(alignof(XAUDIO2_VOICE_STATE) == 1);

Removing from 0.0.0 milestone. Would still be nice to autogenerate, but that can wait.

MaulingMonkey commented 9 months ago

Pull a https://github.com/MaulingMonkey/thindx-xinput/blob/3dfe32738c174ecdfcd49db2aed323d2bc8ad2a5/src/interop/cpp.rs