Re: [hatari-devel] Switching from SDL_types.h to inttypes.h ? |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/hatari-devel Archives
]
- To: hatari-devel@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [hatari-devel] Switching from SDL_types.h to inttypes.h ?
- From: Andreas Grabher <andreas_g86@xxxxxxxxxx>
- Date: Fri, 30 Sep 2022 06:44:07 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=icloud.com; s=1a1hai; t=1664513052; bh=T3qHGuSMoqqkiA/6333/0zkoyxkqzrdTWqMqzwTXqJs=; h=Content-Type:From:Mime-Version:Subject:Date:Message-Id:To; b=GE4IxEq4GjdUVHpS5o7cXNshK0ANNWZ0wUkTdffz7b/uSEo6/RBEe69kgVNKBFCbS Osg+maP1od+bu1SZYNu4jicG/UT8yx9tgpvEjkgPxatf9qhwuMEA6KyE/NLzT+IIUK IM4ne1X5PwapTeBQd5nvmaTGR3KyocyramDf8waJyXZhD10TjSduv1Ifg+xx5mlHFy vxjYhHxeGQS6aYYI5m0AoCtdhqFnqGCm3z9skbhDb84fGi5j9BapewjdaoC9IXA3Pd SJ/VgereKY3BIyL+R+zmkOavAA5zXj79XL7dfcvGmDasFAsOqQzNFOz/Vry65GYOjH POG7U5neytBCw==
> Am 30.09.2022 um 01:11 schrieb Eero Tamminen <oak@xxxxxxxxxxxxxx>:
>
> 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
I agree that the uae types should be kept. But maybe it now makes sense to typedef them from the inttypes now. It would be a little simplification.