dangmoody / HLML

Auto-generated maths library for C and C++ based on HLSL/Cg
24 stars 1 forks source link

Identical Bool Sizes Between Compilers #5

Closed Flave229 closed 5 years ago

Flave229 commented 5 years ago

The size of a bool can change depending on what compiler is used to compile the program (Or even defined by the user).

HLML ideally needs some way to always guarantee that its bool types are the same size. My use case for this would be sending data to a shader via a uniform buffer, data may become misaligned when using different compilers to target different platforms.

dangmoody commented 5 years ago

This was something I forgot to put a TODO on during day 1.

The main problem here is that stdint.h doesn't give a bool32 type so people generally make their own, which means that coming up with a non-intrusive/non-conflicting bool type is difficult.

I'll add one with the name bool32_t, and if people complain that it conflicts then we'll deal with it then.

dangmoody commented 5 years ago

Fixed in v0.3.1.