News for hackers. Stuff that matters.
Re:RGFW: Single-header C99 window abstraction library by flohofwoe on Saturday November 23, 2024 @11:51AM (#42221818)
Since you're using C99 as the base C version, why not use the fixed-width types from stdint.h (int32_t, int64_t, ...)?

You can still typedef those to i32, i64 shortcuts etc, but I would try to avoid this in libraries since it might collide with user typedefs of the same name - or at least try to avoid it in the public API declarations.

Re:RGFW: Single-header C99 window abstraction library by colleagueRiley on Saturday November 23, 2024 @11:58AM (#42221876)
I use those by default although I read that MSVC's support for those are iffy. I'm pretty sure STB does the same thing for the same reason.

Source: https://handmade.network/forums/articles/t/7138-how_to_write...

Re:RGFW: Single-header C99 window abstraction library by flohofwoe on Saturday November 23, 2024 @12:00PM (#42221893)
Since around Visual Studio 2015 you're fine.

AFAIK the STB headers are on C89 mainly because nothings likes to use VC6 as C IDE.

E.g. if you depend on other C99 features anyway, including stdint.h is fine, also on MSVC.

PS: FWIW I use stdint.h types in the Sokol headers since around 2017 and never heard complaints from users, with the supported compilers being MSVC, GCC and Clang.

Re:RGFW: Single-header C99 window abstraction library by colleagueRiley on Saturday November 23, 2024 @12:08PM (#42221952)
Oh, I wasn't sure if that was you :)

Thanks for the advice, I'm a little worried about breaking compatibility with compilers that don't support stdint. But if it's standard for C99 thing then sure.

Re:RGFW: Single-header C99 window abstraction library by eska on Saturday November 23, 2024 @12:33PM (#42222139)
Since around Visual Studio 2015 you're fine.

I personally use `_MSC_VER >= 1600`, so it's since Visual Studio 2010 from April 2010. Built-in types like __int32 from before then may be used as well.