1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-02-15 04:32:24 +00:00

linux: build with thread safety and REENTRANT enabled.

There was a check in linux.cf for the Linux libc version that didn't
work, since these were never set anywhere.  Presumably current Xorg
imake sets these, but since we aren't using that... (yet)

As a result, the build assumed that thread-safe API's were not
supported.  Setting the default libc major version to '6' allows the
proper build to take place.  libc5 was never threadsafe and no one has
probably used it in over 10 years.

As a result, some earlier porting fixes that referenced '__fds_bits'
on linux systems had to be reverted as these are not valid in an MT
environment.  They are also not neccessary when building in such an
environment, as the normal 'fds_bits' works fine.

This patch defintely needs testing on many linux systems.
This commit is contained in:
Jon Trulson 2014-03-24 17:15:40 -06:00
parent 2f4072ee69
commit 9b699d3fb1
3 changed files with 17 additions and 13 deletions

View file

@ -34,17 +34,29 @@ XCOMM platform: $TOG: linux.cf /main/47 1998/04/17 11:32:51 mgreess $
LinuxYggdrasil (12) LinuxYggdrasil (12)
*/ */
#endif #endif
#ifndef DefaultLinuxCLibMajorVersion
# define DefaultLinuxCLibMajorVersion 6
#endif
#ifndef DefaultLinuxCLibMinorVersion
# define DefaultLinuxCLibMinorVersion 0
#endif
#ifndef DefaultLinuxCLibTeenyVersion
# define DefaultLinuxCLibTeenyVersion 0
#endif
#ifndef LinuxCLibMajorVersion #ifndef LinuxCLibMajorVersion
# define LinuxCLibMajorVersion DefaultLinuxCLibMajorVersion # define LinuxCLibMajorVersion DefaultLinuxCLibMajorVersion
#endif #endif
#ifndef LinuxCLibMinorVersion #ifndef LinuxCLibMinorVersion
# define LinuxCLibMinorVersion DefaultLinuxCLibMinorVersion # define LinuxCLibMinorVersion DefaultLinuxCLibMinorVersion
#endif #endif
#ifndef LinuxCLibTeenyVersion #ifndef LinuxCLibTeenyVersion
# define LinuxCLibTeenyVersion DefaultLinuxCLibTeenyVersion # define LinuxCLibTeenyVersion DefaultLinuxCLibTeenyVersion
#endif #endif
#ifndef LinuxBinUtilsMajorVersion #ifndef LinuxBinUtilsMajorVersion
# define LinuxBinUtilsMajorVersion DefaultLinuxBinUtilsMajorVersion # define LinuxBinUtilsMajorVersion DefaultLinuxBinUtilsMajorVersion
#endif #endif
XCOMM operating system: OSName (OSMajorVersion./**/OSMinorVersion./**/OSTeenyVersion) XCOMM operating system: OSName (OSMajorVersion./**/OSMinorVersion./**/OSTeenyVersion)

View file

@ -69,11 +69,8 @@ _DtCm_register_xtcallback(XtAppContext appct)
return; return;
/* assuming only 1 bit is set */ /* assuming only 1 bit is set */
#if defined(linux)
bits = fdset.__fds_bits;
#else
bits = fdset.fds_bits; bits = fdset.fds_bits;
#endif
for (i = 0; i < FD_SETSIZE; i += NFDBITS) { for (i = 0; i < FD_SETSIZE; i += NFDBITS) {
fmask = *bits; fmask = *bits;
for (j = 0; fmask != 0; j++, fmask >>= 1) { for (j = 0; fmask != 0; j++, fmask >>= 1) {

View file

@ -86,13 +86,8 @@ void SPCD_MainLoopUntil(Boolean *flag)
int result; int result;
do { do {
for (n=0; n<fd_vec_size; n++) { for (n=0; n<fd_vec_size; n++) {
#if defined(linux)
input_mask.__fds_bits[n] = Sb_Input_Mask.__fds_bits[n];
except_mask.__fds_bits[n] = Sb_Except_Mask.__fds_bits[n];
#else
input_mask.fds_bits[n] = Sb_Input_Mask.fds_bits[n]; input_mask.fds_bits[n] = Sb_Input_Mask.fds_bits[n];
except_mask.fds_bits[n] = Sb_Except_Mask.fds_bits[n]; except_mask.fds_bits[n] = Sb_Except_Mask.fds_bits[n];
#endif
} }
do result=select(SPCD_max_fd + 1, FD_SET_CAST(&input_mask), do result=select(SPCD_max_fd + 1, FD_SET_CAST(&input_mask),