Re: [hatari-devel] Switching from SDL_types.h to inttypes.h ? |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/hatari-devel Archives
]
Hi,
On 29.9.2022 12.09, Andreas Grabher wrote:
Am 29.09.2022 um 11:07 schrieb Chris Jenkins <cdpjenkins@xxxxxxxxx>:
A general point from me on this: it's really annoying that SDL (and seemingly every other library ever) defines its own typedefs for integer types. Presumably there's a historical reason for that but I really wish it wasn't like that.
Blame Microsoft and MSVC:
https://en.wikipedia.org/wiki/Microsoft_Visual_C%2B%2B#C
-----------------------------------------
"There had been no plans to support C99 even in 2011, more than a decade
after its publication.
Visual C++ 2013 finally added support for various C99 features in its C
mode (...) though it was still not complete. Visual C++ 2015 further
improved the C99 support ..."
-----------------------------------------
I.e. if major C-project wanted to support Windows well, it still needed
its own typedefs over decade after C99 came out.
> I don‘t see any benefit from keeping the SDL-types in some cases. I
suggest to either keep them all or replace them all.
I agree. If there were some way to force compiler to warn about them,
it might be reasonable, but with C compiler doing silent integer
promotions, trying to keep and reason about "relevant" SDL typedefs is
just hopeless.
(As I stated earlier, I see some value in keeping CPU core uae_u* types
as WinUAE functions are not properly prefixed, like SDL ones are.)
- Eero