[SDL] SDL 2.0 ABI locked

Jared Maddox absinthdraco at gmail.com
Mon Mar 18 03:25:03 PDT 2013


> Date: Sun, 17 Mar 2013 10:21:15 -0700
> From: Forest Hale <havoc at ghdigital.com>
> To: SDL Development List <sdl at lists.libsdl.org>
> Subject: Re: [SDL] SDL 2.0 ABI locked
> Message-ID: <5145FB8B.1050504 at ghdigital.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> In the bizarro-land known as the real-world development cycle, a lot of
> people are still using Microsoft Visual Studio 2008, which lacks stdint.h
> (as I discovered when attempting to use ffmpeg headers
> in an app and wound up having to modify them all to not depend on
> stdint.h).
>
> I agree stdint.h is a good thing, it just has complications in practice
> still.
>

> Date: Sun, 17 Mar 2013 14:12:12 -0400
> From: John <john at leafygreengames.com>
> To: sdl at lists.libsdl.org
> Subject: Re: [SDL] SDL 2.0 ABI locked
> Message-ID: <5146077C.9040100 at leafygreengames.com>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> The simplest solution for those who are forced to use older compilers
> missing
> the header is to add your own stdint.h, either by hand, or by copying an
> existing one. That way, the problem of the missing header does not infect
> your
> code. Your code can use the modern types yet remain portable to older
> compilers.
>

> Date: Sun, 17 Mar 2013 21:35:18 +0300
> From: Alexey Petruchik <i100500 at gmail.com>
> To: SDL Development List <sdl at lists.libsdl.org>
> Subject: Re: [SDL] SDL 2.0 ABI locked
> Message-ID:
> 	<CAB1qPCkRipmiN7oOr48PuBrHn2SQO6b1qYn=8Hb0wBjp6DKVbw at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
>> which lacks stdint.h
> But SDL defines missing stdint.h types if needed!  Just look at
> SDL_config_windows.h
>

> Date: Sun, 17 Mar 2013 19:42:31 -0300
> From: Sik the hedgehog <sik.the.hedgehog at gmail.com>
> To: sdl at lists.libsdl.org
> Subject: Re: [SDL] SDL 2.0 ABI locked
> Message-ID:
> 	<CAEyBR+WbkHs1L1s-r3UanM-cPX1kN+zOLS14MaXtRgzTVRF9Pw at mail.gmail.com>
> Content-Type: text/plain; charset=UTF-8
>
> But stdint.h is part of the standard and would affect way more than
> just SDL. If you don't have one you probably are going to have even
> more issues later. Besides SDL's own types aren't very safe anyway -
> they aren't prefixed, and the names are quite predictable (e.g.
> Uint8), chances are several other libraries have those same exact
> typedefs too and will conflict with SDL as well. It's a lose-lose
> situation no matter what.
>

Maybe a SDL_stdint.h file that includes the platform's stdint.h (if
applicable), and typedefs SDL*int* types with any necessary
combination of the types provided by the standard and SDL-provided
types? That way you make the types reliably available to users
(possibly including defines for their min/max values if someone wants
to add those later), avoid stepping on the toes of other libraries
that provide a stdint.h, and if you want to add the appropriate
preprocessor code you can even use other library's stdint.h (I'm not
certain that it's standard compliant, so tell me if it isn't, but you
check for a macro definition, and if it's defined you stick that macro
in the spot reserved for an include statement's filename argument).

After that, whoever did this would just typedef SDL's current types in
terms of the SDL*int* ones. As I understand the standard, anyone could
afterwards start converting e.g. Uint8 to SDLuint8 without any
problems, and the current "unsafe" names could eventually be abandoned
and (let's say SDL 2.5, if conversion is completed in SDL 2.1) removed
(as far as I've been able to figure out, typedef names actually
register as the basal type instead of a unique type; whenever I
actually spend the time to get a compiler written, I'm definitely NOT
blindly adopting that from C).

> Date: Sun, 17 Mar 2013 15:00:35 -0700
> From: "Nathaniel J Fries" <nfries88 at yahoo.com>
> To: sdl at lists.libsdl.org
> Subject: Re: [SDL] SDL 2.0 ABI locked
> Message-ID: <1363557635.m2f.36155 at forums.libsdl.org>
> Content-Type: text/plain; charset="iso-8859-1"
>
>
> Alexey Petruchik wrote:
>>
>> > which lacks stdint.h
>> >
>> But SDL defines missing stdint.h types if needed!  Just look at
>> SDL_config_windows.h
>>
>
>
> If every library defined the stdint types in the case of missing stdint.h,
> every library's header would conflict, and use of multiple libraries would
> require modifying the headers. And requiring a person to download a
> third-party header is impractical (indeed, one of the things I like about
> SDL as opposed to SFML and other similar libraries is that SDL has no
> third-party dependencies).
>
> ------------------------
> Nate Fries

Sorry, but this time I think it makes sense to provide it, especially
since it should be possible to use the headers that other libraries
provide too. There's no reason why an implementation has to step on
others toes.



More information about the SDL mailing list