Sdl's data types for integers

before i knew about stdint.h i had been using sdl’s integer types
Sint32, Uint32 etc. is stdint.h avaliable on most or all systems? if
it is, could sdl move to using the integer types in stdint.h ? if not
then provide the integer types in stdint.h? and probably still provide
Sint32 and Uint32 for backward compatibility ?

with cpu’s moving toward 64 bit (at least for desktop) it seems that
using the exact data type needed is better that assuming the size of
int and short.

in my app i have been strictly using the data types in stdint.h to keep
my app cross platform and to avoid problems with situations where int
is not 32 bits or long is 32 or 64 bit.

just an idea…

does anyone else use stdint.h ?

matt

I’m confused. SDL provides a platform independent way of getting
exact integer types (signed 32 bit vs unsigned 16 bit vs signed 8 bit, etc.)

So why not just use SDL’s types, and guarantee yourself portability on
the platforms where <stdint.h> is not available???On Mon, Aug 20, 2007 at 10:49:38PM -0500, matt wrote:

before i knew about stdint.h i had been using sdl’s integer types
Sint32, Uint32 etc. is stdint.h avaliable on most or all systems? if
it is, could sdl move to using the integer types in stdint.h ? if not
then provide the integer types in stdint.h? and probably still provide
Sint32 and Uint32 for backward compatibility ?


-bill!
bill at newbreedsoftware.com
http://www.newbreedsoftware.com/

before i knew about stdint.h i had been using sdl’s integer types
Sint32, Uint32 etc. is stdint.h avaliable on most or all systems?
if it is, could sdl move to using the integer types in stdint.h ?
if not then provide the integer types in stdint.h? and probably
still provide Sint32 and Uint32 for backward compatibility ?

I’m confused. SDL provides a platform independent way of getting
exact integer types (signed 32 bit vs unsigned 16 bit vs signed 8
bit, etc.)

So why not just use SDL’s types, and guarantee yourself portability
on the platforms where <stdint.h> is not available???

i thought that stdint.h was a C99 standard and should be available
where C99 is ?

only reason i ask is that the core of my app is C with no libs, and
then there is the graphics section that uses sdl. in the core i have
all stdint.h integer types and in the sdl core i have both stdint.h and
sdl integer types.

i am not saying sdl is wrong or bad for having their own types, but
seems that stdint.h doesnt get used enough.

i was just asking…

dont get me wrong, i think sdl is wonderful for cross platform
applications. i can compile on unix, linux, and osx. and it will run
the same. ( no idea how to run a configure script on windows should i
find a windows computer )

mattOn Mon, 20 Aug 2007 22:38:35 -0700 Bill Kendrick wrote:

On Mon, Aug 20, 2007 at 10:49:38PM -0500, matt wrote:

i thought that stdint.h was a C99 standard and should be available
where C99 is ?

That’s correct. However, C99 is not nearly as “available” as you might
think.

b

Microsoft Visual C++ is one example compiler where stdint.h isn’t
provided. It’s a pain.

PeterOn 21/08/07, matt wrote:

On Mon, 20 Aug 2007 22:38:35 -0700 Bill Kendrick wrote:

On Mon, Aug 20, 2007 at 10:49:38PM -0500, matt wrote:

before i knew about stdint.h i had been using sdl’s integer types
Sint32, Uint32 etc. is stdint.h avaliable on most or all systems?
if it is, could sdl move to using the integer types in stdint.h ?
if not then provide the integer types in stdint.h? and probably
still provide Sint32 and Uint32 for backward compatibility ?

I’m confused. SDL provides a platform independent way of getting
exact integer types (signed 32 bit vs unsigned 16 bit vs signed 8
bit, etc.)

So why not just use SDL’s types, and guarantee yourself portability
on the platforms where <stdint.h> is not available???

i thought that stdint.h was a C99 standard and should be available
where C99 is ?

only reason i ask is that the core of my app is C with no libs, and
then there is the graphics section that uses sdl. in the core i have
all stdint.h integer types and in the sdl core i have both stdint.h and
sdl integer types.

i am not saying sdl is wrong or bad for having their own types, but
seems that stdint.h doesnt get used enough.

i was just asking…

dont get me wrong, i think sdl is wonderful for cross platform
applications. i can compile on unix, linux, and osx. and it will run
the same. ( no idea how to run a configure script on windows should i
find a windows computer )

matt


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

( no idea how to run a configure script on windows should i
find a windows computer )

MSys gives you a minimalistic GNU toolchain for Windows:
http://www.mingw.org/msys.shtml

It has bash, GNU make, GNU sed, gawk and of course tar and gzip
and a few other tools you might need.

But MinGW can also be used as a cross-compiler,
and then you can test your programs with wine… :wink:

SCNRAm Tuesday, dem 21. Aug 2007 schrieb matt:


AKFoerster

does anyone else use stdint.h ?

I do in some projects, but there are lots of places it isn’t available.

SDL uses stdint.h to define Uint32 (etc) when it can, but it handles the
platforms that don’t offer it.

–ryan.