sccn / liblsl

C++ lsl library for multi-modal time-synched data transmission over the local network
Other
108 stars 63 forks source link

Ensure enums are 4 bytes wide as implicitly assumed in previous versions #84

Closed tstenner closed 3 years ago

tstenner commented 3 years ago

The original issue is in #83. Basically, the API has several enums that were passed as 4 byte wide parameters to functions. The C# bindings assumed the enums were single bytes, but the 3 bytes padding before the next parameter made it (mostly) work on little endian architectures.

This PR prevents the compiler from reserving a single byte for the enums and aborts compilation with a helpful error message (on most modern compilers) or at least an error with a line number and explanation on older compilers.

chkothe commented 3 years ago

Looks good to merge to me