_reentrant?

i notice the sdl-config says to use the flag -D_REENTRANT for
one of the compiler flags. coming more from windows, i’m just
trying to get the background on this flag.

this little macro is not used anywhere in the SDL source, so
i assume something SDL is using (glib? X11?) needs _REENTRANT
defined for something. i’m curious who’s headers need this flag?

i’ve done some testing on linux without this flag and things
seemed ok. likely i was not stressing a critical reentrant section
of code all that much :]

_REENTRANT is used for building dynamic libraries under unix. I think you
have to have a -DfPIC option set too.

-Ryan Phillips

“Pete Shinners” wrote in message
news:8vc3u9$dop$1 at ftp.lokigames.com…> i notice the sdl-config says to use the flag -D_REENTRANT for

one of the compiler flags. coming more from windows, i’m just
trying to get the background on this flag.

this little macro is not used anywhere in the SDL source, so
i assume something SDL is using (glib? X11?) needs _REENTRANT
defined for something. i’m curious who’s headers need this flag?

i’ve done some testing on linux without this flag and things
seemed ok. likely i was not stressing a critical reentrant section
of code all that much :]

i notice the sdl-config says to use the flag -D_REENTRANT for
one of the compiler flags. coming more from windows, i’m just
trying to get the background on this flag.

It sets some flags in the C headers giving you reentrant versions
of some interfaces, particularly errno.

See ya,
-Sam Lantinga, Lead Programmer, Loki Entertainment Software

i notice the sdl-config says to use the flag -D_REENTRANT for
one of the compiler flags. coming more from windows, i’m just
trying to get the background on this flag.

this little macro is not used anywhere in the SDL source, so
i assume something SDL is using (glib? X11?) needs _REENTRANT
defined for something. i’m curious who’s headers need this flag?

i’ve done some testing on linux without this flag and things
seemed ok. likely i was not stressing a critical reentrant section
of code all that much :]

Actually, -D_REENTRANT is used in glibc to mark off areas to use
threadsafe rather than thread-unsafe methods for some things.

You may find a multithreaded program hrmm quite a bit less stable on a
multiprocessor system if you don’t have this enabled.

IIRC the main system affected is actually I/O
(fprintf/fscanf/read/write/…)
Just did a quick scan - pretty much that + networking.

So it’s a glibc issue - which should affect any platform running
glibc. Linux, BSD probably and other unix varients, possibly cygwin32 and
maybe mingwin32 as well. Doesn’t affect VisualC++ though.

That help at all? (I know more about this 'cause it made it possible to
write multithreaded programs that -used- libc… made me happy :slight_smile:
I -like- multithreading.

G’day, eh? :slight_smile:
- TeunisOn Mon, 20 Nov 2000, Pete Shinners wrote: