RandyGaul / cute_headers

Collection of cross-platform one-file C/C++ libraries with no dependencies, primarily used for games
4.24k stars 264 forks source link

[cute_net] fix compiling with clang on windows #333

Closed ruby0x1 closed 1 year ago

ruby0x1 commented 1 year ago

When compiling with clang on windows MSC_VER is defined and can conflict, leading to an unclear error (below). The real cause is the alignment macro which has accidentally used the MSVC compatible one instead of the clang compatible one.

cute_net.h(1663,24): error: default initialization of an object of const type 'const uint32_t [24]'
 static const uint32_t coeffs[24] __declspec(align(16)) = {
                       ^
cute_net.h(1663,34): error: expected ';' after top level declarator
 static const uint32_t coeffs[24] __declspec(align(16)) = {
                                 ^
                                 ;
cute_net.h(1663,57): error: expected unqualified-id
 static const uint32_t coeffs[24] __declspec(align(16)) = {
RandyGaul commented 1 year ago

Looks good, thank you very much! Please let me know if you find any other problems.