[SDL] Solaris nitpicks

Mattias Engdegård f91-men at nada.kth.se
Thu Aug 30 09:11:00 PDT 2001

Drazen Kacar <dave at arsdigita.com> wrote:
>I used Sun's compiler and everything went fine except 64-bit data type.
>SDL_types.h has a rather poor way of detecting if it's available and the
>method failed, because this compiler wasn't listed.

yes that code is a smelly heap of dung. I thought I had band-aided it for
the WorkShop compiler; I'll look at it when I can

> 1. checked if <inttypes.h> header is available on the system
> 2. if so, check if int_least64_t and uint_least64_t are defined
>    3. if so, those types are exactly what's needed
>    4. if there are no *_least64_t types, check for int64_t and uint64_t
>       5. if they exist, they can hold at least 64 bits, but might be
>          larger, so use them if they are exactly 64-bits wide.

while we'll probably use the configure script to find a 64-bit data
type the above is an overkill --- we need a type exact 64 bit or none
at all. Nothing for 1.2 at any rate

>Those types are defined by C99 and a growing number of systems has them
>defined these days. Using them would also enable having 32-bit and 64-bit
>SDL library on the same system, but with the same header file.

That should be possible to arrange anyway. I'll have a look

>SDL_x11image.c has a function num_CPU() which tries to determine number of
>processors from kstat structures. The code mostly works, but it would be
>somewhat simpler to replace it with:

"mostly works", meaning that it sometimes does not. Please be more
specific. I'll be happy to replace if with the sysconf() if you can
verify its availability for Solaris 2.5.1 and onwards

>Something very close is being done if __USLC__ symbol is defined, but I
>don't know what's being identified by it. It's usually not defined by
>compilers on Solaris.

I don't know where that comes from. Sam, do you remember?

>The linking method has a small problem. "sdl-config --libs" outputs only
>-lpthread. This is enough to make things work, but there's one case when
>it won't give the expected results

the 1:1 thread lib is new in sol 8 and I didn't want to special-case
for it. When does it not give expected results? I'm not sure what
faults in the Solaris scheduler you are referring to, but shouldn't
it be enough to request the threads to be bound?

Thanks for your comments though, I'll look at it when I get better
(damn cold)

More information about the SDL mailing list