Re: [hatari-devel] Switching from SDL_types.h to inttypes.h ?

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Hi,

On 24.9.2022 14.53, Thomas Huth wrote:
The recent changes wrt FindSDL2.cmake made me aware again of the fact that
almost all our source files depend on the SDL headers - which can be
cumbersome in situations like this (since you've got to add
target_link_library() to each and every internal sub-library of the
project). This dependencies exists mainly because we're including
<SDL_types.h> in our main.h to get the old-fashioned types like Uint16 etc.

Now, in some parts of the Hatari sources, we already use the types from
stdint.h / inttypes.h instead, which also work without the SDL headers, so
it's currently quite a mix of types that we have in the sources. I wonder
whether we should slowly try to move away from the SDL types and finally
include "inttypes.h" in main.h instead? That way, the Hatari sources could
also be easier used in spots that should not directly link to the SDL
library (like the files in tests/debugger/ for example)...

Opinions? Would it be OK to switch non-SDL related files to uint16_t
instead of Uint16 etc. ? Or is anybody really keen on keeping the SDL types?

I'm in favor of using standard types instead of SDL ones.

(And that change does not need to be slow one, as one can do most of the transition with sed, and if it compiles, it's fine.)


	- Eero



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/