Index: config/cf/FreeBSD.cf =================================================================== RCS file: /cvs/xorg/xc/config/cf/FreeBSD.cf,v retrieving revision 1.2 diff -u -r1.2 FreeBSD.cf --- config/cf/FreeBSD.cf 23 Apr 2004 18:41:58 -0000 1.2 +++ config/cf/FreeBSD.cf 18 May 2004 07:34:02 -0000 @@ -112,39 +112,27 @@ /* 2.2.7 and later has libc_r (POSIX threads) */ #if OSMajorVersion == 2 && OSMinorVersion == 2 && OSTeenyVersion >= 7 || \ OSMajorVersion >= 3 -# ifndef HasLibPthread -# define HasLibPthread NO -# endif # define HasPosixThreads YES # define ThreadedX YES -# define SystemMTDefines -D_REENTRANT -D_THREAD_SAFE -/* - * FreeBSD has tread-safe api but no getpwnam_r yet. - */ # define HasThreadSafeAPI YES # if OSRelVersion < 501000 # define MTSafeAPIDefines -DXUSE_MTSAFE_API -DXNO_MTSAFE_PWDAPI # else # define MTSafeAPIDefines -DXUSE_MTSAFE_API # endif -# if HasLibPthread +# if (OSRelVersion < 500043) +# define NeedUIThrStubs YES +# endif +# if (OSRelVersion >= 502102) # define ThreadsLibraries -lpthread # else -# if OSRelVersion >= 500043 -# define BuildThreadStubLibrary NO -# define NeedUIThrStubs NO -# else -# define BuildThreadStubLibrary YES -# define NeedUIThrStubs YES -# endif # if (OSRelVersion >= 500016) # define ThreadsLibraries -lc_r -# define SharedGLReqs $(LDPRELIBS) $(XLIB) -lc +# define SystemMTDefines -D_THREAD_SAFE # else # define ThreadsLibraries -pthread +# define SystemMTDefines -D_THREAD_SAFE # endif -# define SharedX11Reqs $(LDPRELIB) $(XTHRSTUBLIB) -# define SharedXtReqs $(LDPRELIB) $(XONLYLIB) $(SMLIB) $(ICELIB) $(XTHRSTUBLIB) # endif #endif @@ -193,19 +181,8 @@ #endif #endif -/* - * Add an LD_LIBRARY_PATH environment variable, defined by $(CLIENTENVSETUP), - * when building X to avoid that for each client ld give the message - * - * ld: warning: libXThrStub.so.6, needed by libX11.so, not found - */ -#if BuildThreadStubLibrary && (!defined(UseInstalledX11) || !UseInstalledX11) -# define CcCmd $(CLIENTENVSETUP) cc -# define CplusplusCmd $(CLIENTENVSETUP) c++ -#else -# define CcCmd cc -# define CplusplusCmd c++ -#endif +#define CcCmd gcc +#define CplusplusCmd g++ #define CppCmd /usr/bin/cpp #define PreProcessCmd CppCmd Index: config/cf/OpenBSD.cf =================================================================== RCS file: /cvs/xorg/xc/config/cf/OpenBSD.cf,v retrieving revision 1.2 diff -u -r1.2 OpenBSD.cf --- config/cf/OpenBSD.cf 23 Apr 2004 18:41:58 -0000 1.2 +++ config/cf/OpenBSD.cf 18 May 2004 07:32:38 -0000 @@ -397,11 +397,6 @@ # endif # define XnestServer NO -# if (OSMajorVersion < 3) -# define HasSharedLibraries NO -# define SharedLibXThrStub NO -# endif - # ifndef XorgServer # if OSMajorVersion == 3 && OSMinorVersion >= 2 || OSMajorVersion > 3 # define XorgServer YES @@ -882,14 +877,9 @@ #if HasWeakSymbols == YES && (OSMajorVersion == 2 && OSMinorVersion >= 6 || OSMajorVersion >= 3) # define HasPosixThreads YES # define ThreadedX YES -# define SystemMTDefines /**/ -# define BuildThreadStubLibrary YES # define NeedUIThrStubs YES # define ThreadsCompileFlag -pthread # define ThreadsLibraries -pthread -# define SharedX11Reqs $(LDPRELIBS) $(XTHRSTUBLIB) -# define SharedXtReqs $(LDPRELIB) $(XONLYLIB) $(SMLIB) \ - $(ICELIB) $(XTHRSTUBLIB) #else # define ThreadedX NO #endif Index: config/cf/OpenBSDLib.tmpl =================================================================== RCS file: /cvs/xorg/xc/config/cf/OpenBSDLib.tmpl,v retrieving revision 1.2 diff -u -r1.2 OpenBSDLib.tmpl --- config/cf/OpenBSDLib.tmpl 23 Apr 2004 18:41:58 -0000 1.2 +++ config/cf/OpenBSDLib.tmpl 18 May 2004 07:31:59 -0000 @@ -16,9 +16,6 @@ # ifndef SharedX11Rev # define SharedX11Rev 7.0 # endif -# ifndef SharedXThrStubRev -# define SharedXThrStubRev 7.0 -# endif # ifndef SharedXextRev # define SharedXextRev 7.0 # endif Index: config/cf/X11.tmpl =================================================================== RCS file: /cvs/xorg/xc/config/cf/X11.tmpl,v retrieving revision 1.7 diff -u -r1.7 X11.tmpl --- config/cf/X11.tmpl 6 May 2004 17:31:16 -0000 1.7 +++ config/cf/X11.tmpl 18 May 2004 07:29:39 -0000 @@ -726,9 +726,6 @@ #ifndef ThreadedProject #define ThreadedProject ThreadedX #endif -#ifndef BuildThreadStubLibrary -#define BuildThreadStubLibrary NO -#endif #ifndef NeedUIThrStubs #define NeedUIThrStubs NO #endif @@ -1772,39 +1769,6 @@ DEPXLIBONLY = $(DEPXONLYLIB) XLIBONLY = $(XONLYLIB) -#if BuildThreadStubLibrary -#ifndef SharedLibXThrStub -#define SharedLibXThrStub YES -#endif -#ifndef NormalLibXThrStub -#define NormalLibXThrStub NO -#endif -#ifndef DebugLibXThrStub -#define DebugLibXThrStub NO -#endif -#ifndef ProfileLibXThrStub -#define ProfileLibXThrStub NO -#endif - XTHRSTUBLIBSRC = $(LIBSRC)/XThrStub -#if SharedLibXThrStub -#ifndef SharedXThrStubRev -#define SharedXThrStubRev 6.1 -#endif -SharedLibReferences(XTHRSTUB,XThrStub,$(XTHRSTUBLIBSRC),SOXTHRSTUBREV,SharedXThrStubRev) -#else -ProjectUnsharedLibReferences(XTHRSTUB,XThrStub,$(XTHRSTUBSRC),XBuildLibDir) -#endif -#else -#undef SharedLibXThrStub -#define SharedLibXThrStub NO -#undef NormalLibXThrStub -#define NormalLibXThrStub NO -#undef DebugLibXThrStub -#define DebugLibXThrStub NO -#undef ProfileLibXThrStub -#define ProfileLibXThrStub NO -#endif - #if BuildScreenSaverLibrary #ifndef SharedLibXss #define SharedLibXss HasSharedLibraries Index: config/cf/os2.cf =================================================================== RCS file: /cvs/xorg/xc/config/cf/os2.cf,v retrieving revision 1.2 diff -u -r1.2 os2.cf --- config/cf/os2.cf 23 Apr 2004 18:41:58 -0000 1.2 +++ config/cf/os2.cf 18 May 2004 07:34:36 -0000 @@ -90,7 +90,6 @@ #define StdIncDir /usr/include #define HasStickyDirBit NO #define HasMkstemp NO -#define BuildThreadStubLibrary NO #define HasBasename NO /* C-function, not shell utility!! */ Index: config/cf/os2Lib.tmpl =================================================================== RCS file: /cvs/xorg/xc/config/cf/os2Lib.tmpl,v retrieving revision 1.2 diff -u -r1.2 os2Lib.tmpl --- config/cf/os2Lib.tmpl 23 Apr 2004 18:41:58 -0000 1.2 +++ config/cf/os2Lib.tmpl 18 May 2004 07:21:12 -0000 @@ -50,7 +50,6 @@ /* library revisions, these are typically empty! */ #define SharedX11Rev /**/ -#define SharedXThrStubRev /**/ #define SharedXextRev /**/ #define SharedXssRev /**/ #define SharedXxf86miscRev /**/ Index: config/cf/xorg.cf =================================================================== RCS file: /cvs/xorg/xc/config/cf/xorg.cf,v retrieving revision 1.5 diff -u -r1.5 xorg.cf --- config/cf/xorg.cf 4 May 2004 22:58:59 -0000 1.5 +++ config/cf/xorg.cf 18 May 2004 07:57:11 -0000 @@ -485,7 +485,8 @@ # define XF86CardDrivers mga glint nv tga s3 s3virge sis rendition \ neomagic tdfx savage cirrus tseng trident \ chips apm i128 ati ark cyrix siliconmotion \ - vga dummy fbdev vesa + vga dummy fbdev vesa \ + XF86OSCardDrivers XF86ExtraCardDrivers # endif /* DRI tdfx driver needs Glide, which is not available for AMD64 */ Index: lib/Imakefile =================================================================== RCS file: /cvs/xorg/xc/lib/Imakefile,v retrieving revision 1.2 diff -u -r1.2 Imakefile --- lib/Imakefile 23 Apr 2004 18:43:08 -0000 1.2 +++ lib/Imakefile 18 May 2004 07:26:23 -0000 @@ -28,10 +28,6 @@ XKBUILIBDIR = xkbui #endif -#if BuildThreadStubLibrary && BuildLibraries -THRSTUBLIBDIR = XThrStub -#endif - #if BuildXInputLib XINPUTLIBDIR = Xi #endif @@ -198,7 +194,7 @@ #endif -LINTSUBDIRS = $(XAULIBDIR) $(XDMCPLIBDIR) $(THRSTUBLIBDIR) $(X11LIBDIR) \ +LINTSUBDIRS = $(XAULIBDIR) $(XDMCPLIBDIR) $(X11LIBDIR) \ $(OLDXLIBDIR) $(ICELIBDIR) $(SMLIBDIR) $(XEXTLIBDIR) $(XTLIBDIR) \ $(SSLIBDIR) $(XF86MISCLIBDIR) $(XF86VMLIBDIR) $(XF86DGALIBDIR) \ $(XF86RUSHLIBDIR) $(XMULIBDIR) $(XMUULIBDIR) $(XPMLIBDIR) \ Index: lib/GL/GL/Imakefile =================================================================== RCS file: /cvs/xorg/xc/lib/GL/GL/Imakefile,v retrieving revision 1.2 diff -u -r1.2 Imakefile --- lib/GL/GL/Imakefile 23 Apr 2004 18:43:09 -0000 1.2 +++ lib/GL/GL/Imakefile 18 May 2004 07:54:15 -0000 @@ -224,12 +224,8 @@ POBJS = $(GLXPOBJS) $(DRIPOBJS) $(DRVPOBJS) #if LocalThreads -#if NeedUIThrStubs - THREADOBJS = $(LDPRELIB) $(XTHRSTUBLIB) -#else THREADOBJS = $(THREADS_LIBS) #endif -#endif #include Index: lib/X11/Imakefile =================================================================== RCS file: /cvs/xorg/xc/lib/X11/Imakefile,v retrieving revision 1.2 diff -u -r1.2 Imakefile --- lib/X11/Imakefile 23 Apr 2004 18:43:24 -0000 1.2 +++ lib/X11/Imakefile 18 May 2004 08:49:28 -0000 @@ -123,6 +123,11 @@ K5INCL = Krb5Includes K5DEFS = Krb5Defines #endif +#if (defined(FreeBSDArchitecture) && OSRelVersion < 500016) || \ + defined(OpenBSDArchitecture) +THRSTUBSRCS = UIThrStubs.c +THRSTUBOBJS = UIThrStubs.o +#endif #if BuildLoadableXlibXcursor XCURSOR_DEFINES = -DUSE_DYNAMIC_XCURSOR -DLIBXCURSOR=\"libXcursor.so.$(SOXCURSORREV)\" #endif @@ -149,6 +154,7 @@ EXTRASTATICSRC = $(STATICLCSRCS) #endif + EXTRASRCS = $(EXTRASHAREDSRC) $(EXTRASTATICSRC) SRCS1 = \ @@ -531,7 +537,7 @@ Withdraw.c \ WMGeom.c \ WMProps.c \ - $(AUTHSRCS) $(XDMAUTHSRCS) $(K5SRCS) + $(AUTHSRCS) $(XDMAUTHSRCS) $(K5SRCS) $(THRSTUBSRCS) OBJS2 = \ Macros.o \ @@ -655,7 +661,8 @@ WMProps.o \ $(AUTHOBJS) \ $(XDMAUTHOBJS) \ - $(K5OBJS) + $(K5OBJS) \ + $(THRSTUBOBJS) SRCS3 = \ Lab.c \ Index: lib/X11/UIThrStubs.c =================================================================== RCS file: lib/X11/UIThrStubs.c diff -N lib/X11/UIThrStubs.c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lib/X11/UIThrStubs.c 23 Apr 2004 18:43:36 -0000 @@ -0,0 +1,157 @@ +/* + * $XFree86: xc/lib/XThrStub/UIThrStubs.c,v 3.3 2001/11/18 21:13:26 herrb Exp $ + * + * Copyright (c) 1995 David E. Wexelblat. All rights reserved + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL DAVID E. WEXELBLAT BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the name of David E. Wexelblat shall + * not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization + * from David E. Wexelblat. + * + */ + +/* + * Stubs for thread functions needed by the X library. Supports + * UnixWare 2.x threads; may support Solaris 2 threads as well, but not + * tested. Defining things this way removes the dependency of the X + * library on the threads library, but still supports threads if the user + * specificies the thread library on the link line. + */ + +/* + * Modifications by Carlos A M dos Santos, XFree86 Project, November 1999. + * + * Explanation from : + * The structure below is complicated, mostly because P1003.1c (the + * IEEE POSIX Threads spec) went through lots of drafts, and some + * vendors shipped systems based on draft API that were changed later. + * Unfortunately POSIX did not provide a feature-test macro for + * distinguishing each of the drafts. + */ + +#ifdef CTHREADS +#include +typedef cthread_t xthread_t; +#define xthread_self cthread_self +#pragma weak cthread_self = _Xthr_self_stub_ +#define xmutex_init mutex_init +#pragma weak mutex_init = _Xthr_zero_stub_ +#pragma weak mutex_clear = _Xthr_zero_stub_ +#pragma weak mutex_lock = _Xthr_zero_stub_ +#pragma weak mutex_unlock = _Xthr_zero_stub_ +#pragma weak condition_init = _Xthr_zero_stub_ +#pragma weak condition_clear = _Xthr_zero_stub_ +#pragma weak condition_wait = _Xthr_zero_stub_ +#pragma weak condition_signal = _Xthr_zero_stub_ +#pragma weak condition_broadcast = _Xthr_zero_stub_ +#else /* !CTHREADS */ +#if defined(SVR4) && !defined(__sgi) +#include +typedef thread_t xthread_t; +#pragma weak thr_self = _Xthr_self_stub_ +#pragma weak mutex_init = _Xthr_zero_stub_ +#pragma weak mutex_destroy = _Xthr_zero_stub_ +#pragma weak mutex_lock = _Xthr_zero_stub_ +#pragma weak mutex_unlock = _Xthr_zero_stub_ +#pragma weak cond_init = _Xthr_zero_stub_ +#pragma weak cond_destroy = _Xthr_zero_stub_ +#pragma weak cond_wait = _Xthr_zero_stub_ +#pragma weak cond_signal = _Xthr_zero_stub_ +#pragma weak cond_broadcast = _Xthr_zero_stub_ +#else /* !SVR4 */ +#ifdef WIN32 + /* + * Don't know what to do here. Is there something do be done at all? + */ +#else /* !WIN32 */ +#ifdef USE_TIS_SUPPORT +#include +typedef pthread_t xthread_t; +#pragma weak tis_self = _Xthr_self_stub_ +#pragma weak tis_mutex_init = _Xthr_zero_stub_ +#pragma weak tis_mutex_destroy = _Xthr_zero_stub_ +#pragma weak tis_mutex_lock = _Xthr_zero_stub_ +#pragma weak tis_mutex_unlock = _Xthr_zero_stub_ +#pragma weak tis_cond_init = _Xthr_zero_stub_ +#pragma weak tis_cond_destroy = _Xthr_zero_stub_ +#pragma weak tis_cond_wait = _Xthr_zero_stub_ +#pragma weak tis_cond_signal = _Xthr_zero_stub_ +#pragma weak tis_cond_broadcast = _Xthr_zero_stub_ +#else +#include +typedef pthread_t xthread_t; +#if __GNUC__ >= 3 +xthread_t pthread_self() __attribute__ ((weak, alias ("_Xthr_self_stub_"))); +int pthread_mutex_init() __attribute__ ((weak, alias ("_Xthr_zero_stub_"))); +int pthread_mutex_destroy() __attribute__ ((weak, alias ("_Xthr_zero_stub_"))); +int pthread_mutex_lock() __attribute__ ((weak, alias ("_Xthr_zero_stub_"))); +int pthread_mutex_unlock() __attribute__ ((weak, alias ("_Xthr_zero_stub_"))); +int pthread_cond_init() __attribute__ ((weak, alias ("_Xthr_zero_stub_"))); +int pthread_cond_destroy() __attribute__ ((weak, alias ("_Xthr_zero_stub_"))); +int pthread_cond_wait() __attribute__ ((weak, alias ("_Xthr_zero_stub_"))); +int pthread_cond_signal() __attribute__ ((weak, alias ("_Xthr_zero_stub_"))); +int pthread_cond_broadcast() __attribute__ ((weak, alias ("_Xthr_zero_stub_"))); +int pthread_key_create() __attribute__ ((weak, alias ("_Xthr_zero_stub_"))); +void *pthread_getspecific() __attribute__ ((weak, alias ("_Xthr_zero_stub_"))); +int pthread_setspecific() __attribute__ ((weak, alias ("_Xthr_zero_stub_"))); +#else /* __GNUC__ */ +#pragma weak pthread_self = _Xthr_self_stub_ +#pragma weak pthread_mutex_init = _Xthr_zero_stub_ +#pragma weak pthread_mutex_destroy = _Xthr_zero_stub_ +#pragma weak pthread_mutex_lock = _Xthr_zero_stub_ +#pragma weak pthread_mutex_unlock = _Xthr_zero_stub_ +#pragma weak pthread_cond_init = _Xthr_zero_stub_ +#pragma weak pthread_cond_destroy = _Xthr_zero_stub_ +#pragma weak pthread_cond_wait = _Xthr_zero_stub_ +#pragma weak pthread_cond_signal = _Xthr_zero_stub_ +#pragma weak pthread_cond_broadcast = _Xthr_zero_stub_ +/* These are added for libGL */ +#pragma weak pthread_key_create = _Xthr_zero_stub_ +#pragma weak pthread_getspecific = _Xthr_zero_stub_ +#pragma weak pthread_setspecific = _Xthr_zero_stub_ +#endif /* __GNUC__ */ +#if defined(_DECTHREADS_) || defined(linux) +#pragma weak pthread_equal = _Xthr_equal_stub_ /* See Xthreads.h! */ +int +_Xthr_equal_stub_() +{ + return(1); +} +#endif /* _DECTHREADS_ || linux */ +#endif /* USE_TIS_SUPPORT */ +#endif /* WIN32 */ +#endif /* SVR4 */ +#endif /* CTHREADS */ + +static xthread_t +_Xthr_self_stub_() +{ + static xthread_t _X_no_thread_id; + + return(_X_no_thread_id); /* defined by */ +} + +static int +_Xthr_zero_stub_() +{ + return(0); +} Index: lib/XThrStub/Imakefile =================================================================== RCS file: lib/XThrStub/Imakefile diff -N lib/XThrStub/Imakefile --- lib/XThrStub/Imakefile 23 Apr 2004 18:43:36 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,34 +0,0 @@ -XCOMM $XFree86: xc/lib/XThrStub/Imakefile,v 3.1 1996/12/12 09:13:41 dawes Exp $ -#define DoNormalLib NormalLibXThrStub -#define DoSharedLib SharedLibXThrStub -#define DoExtraLib SharedLibXThrStub -#define DoDebugLib DebugLibXThrStub -#define DoProfileLib ProfileLibXThrStub -#define LibName XThrStub -#define SoRev SOXTHRSTUBREV -#define LibHeaders NO - -#include - -#ifdef SharedXThrStubReqs -REQUIREDLIBS = SharedXThrStubReqs -#endif - -#if NeedUIThrStubs -STUBSRCS = UIThrStubs.c -STUBOBJS = UIThrStubs.o -#endif - -#if Malloc0ReturnsNull -ALLOC_DEFINES = -DMALLOC_0_RETURNS_NULL -#endif - - DEFINES = $(ALLOC_DEFINES) - INCLUDES = - SRCS = $(STUBSRCS) - OBJS = $(STUBOBJS) - LINTLIBS = $(LINTXLIB) - -#include - -DependTarget() Index: lib/XThrStub/UIThrStubs.c =================================================================== RCS file: lib/XThrStub/UIThrStubs.c diff -N lib/XThrStub/UIThrStubs.c --- lib/XThrStub/UIThrStubs.c 23 Apr 2004 18:43:36 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,157 +0,0 @@ -/* - * $XFree86: xc/lib/XThrStub/UIThrStubs.c,v 3.3 2001/11/18 21:13:26 herrb Exp $ - * - * Copyright (c) 1995 David E. Wexelblat. All rights reserved - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL DAVID E. WEXELBLAT BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name of David E. Wexelblat shall - * not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization - * from David E. Wexelblat. - * - */ - -/* - * Stubs for thread functions needed by the X library. Supports - * UnixWare 2.x threads; may support Solaris 2 threads as well, but not - * tested. Defining things this way removes the dependency of the X - * library on the threads library, but still supports threads if the user - * specificies the thread library on the link line. - */ - -/* - * Modifications by Carlos A M dos Santos, XFree86 Project, November 1999. - * - * Explanation from : - * The structure below is complicated, mostly because P1003.1c (the - * IEEE POSIX Threads spec) went through lots of drafts, and some - * vendors shipped systems based on draft API that were changed later. - * Unfortunately POSIX did not provide a feature-test macro for - * distinguishing each of the drafts. - */ - -#ifdef CTHREADS -#include -typedef cthread_t xthread_t; -#define xthread_self cthread_self -#pragma weak cthread_self = _Xthr_self_stub_ -#define xmutex_init mutex_init -#pragma weak mutex_init = _Xthr_zero_stub_ -#pragma weak mutex_clear = _Xthr_zero_stub_ -#pragma weak mutex_lock = _Xthr_zero_stub_ -#pragma weak mutex_unlock = _Xthr_zero_stub_ -#pragma weak condition_init = _Xthr_zero_stub_ -#pragma weak condition_clear = _Xthr_zero_stub_ -#pragma weak condition_wait = _Xthr_zero_stub_ -#pragma weak condition_signal = _Xthr_zero_stub_ -#pragma weak condition_broadcast = _Xthr_zero_stub_ -#else /* !CTHREADS */ -#if defined(SVR4) && !defined(__sgi) -#include -typedef thread_t xthread_t; -#pragma weak thr_self = _Xthr_self_stub_ -#pragma weak mutex_init = _Xthr_zero_stub_ -#pragma weak mutex_destroy = _Xthr_zero_stub_ -#pragma weak mutex_lock = _Xthr_zero_stub_ -#pragma weak mutex_unlock = _Xthr_zero_stub_ -#pragma weak cond_init = _Xthr_zero_stub_ -#pragma weak cond_destroy = _Xthr_zero_stub_ -#pragma weak cond_wait = _Xthr_zero_stub_ -#pragma weak cond_signal = _Xthr_zero_stub_ -#pragma weak cond_broadcast = _Xthr_zero_stub_ -#else /* !SVR4 */ -#ifdef WIN32 - /* - * Don't know what to do here. Is there something do be done at all? - */ -#else /* !WIN32 */ -#ifdef USE_TIS_SUPPORT -#include -typedef pthread_t xthread_t; -#pragma weak tis_self = _Xthr_self_stub_ -#pragma weak tis_mutex_init = _Xthr_zero_stub_ -#pragma weak tis_mutex_destroy = _Xthr_zero_stub_ -#pragma weak tis_mutex_lock = _Xthr_zero_stub_ -#pragma weak tis_mutex_unlock = _Xthr_zero_stub_ -#pragma weak tis_cond_init = _Xthr_zero_stub_ -#pragma weak tis_cond_destroy = _Xthr_zero_stub_ -#pragma weak tis_cond_wait = _Xthr_zero_stub_ -#pragma weak tis_cond_signal = _Xthr_zero_stub_ -#pragma weak tis_cond_broadcast = _Xthr_zero_stub_ -#else -#include -typedef pthread_t xthread_t; -#if __GNUC__ >= 3 -xthread_t pthread_self() __attribute__ ((weak, alias ("_Xthr_self_stub_"))); -int pthread_mutex_init() __attribute__ ((weak, alias ("_Xthr_zero_stub_"))); -int pthread_mutex_destroy() __attribute__ ((weak, alias ("_Xthr_zero_stub_"))); -int pthread_mutex_lock() __attribute__ ((weak, alias ("_Xthr_zero_stub_"))); -int pthread_mutex_unlock() __attribute__ ((weak, alias ("_Xthr_zero_stub_"))); -int pthread_cond_init() __attribute__ ((weak, alias ("_Xthr_zero_stub_"))); -int pthread_cond_destroy() __attribute__ ((weak, alias ("_Xthr_zero_stub_"))); -int pthread_cond_wait() __attribute__ ((weak, alias ("_Xthr_zero_stub_"))); -int pthread_cond_signal() __attribute__ ((weak, alias ("_Xthr_zero_stub_"))); -int pthread_cond_broadcast() __attribute__ ((weak, alias ("_Xthr_zero_stub_"))); -int pthread_key_create() __attribute__ ((weak, alias ("_Xthr_zero_stub_"))); -void *pthread_getspecific() __attribute__ ((weak, alias ("_Xthr_zero_stub_"))); -int pthread_setspecific() __attribute__ ((weak, alias ("_Xthr_zero_stub_"))); -#else /* __GNUC__ */ -#pragma weak pthread_self = _Xthr_self_stub_ -#pragma weak pthread_mutex_init = _Xthr_zero_stub_ -#pragma weak pthread_mutex_destroy = _Xthr_zero_stub_ -#pragma weak pthread_mutex_lock = _Xthr_zero_stub_ -#pragma weak pthread_mutex_unlock = _Xthr_zero_stub_ -#pragma weak pthread_cond_init = _Xthr_zero_stub_ -#pragma weak pthread_cond_destroy = _Xthr_zero_stub_ -#pragma weak pthread_cond_wait = _Xthr_zero_stub_ -#pragma weak pthread_cond_signal = _Xthr_zero_stub_ -#pragma weak pthread_cond_broadcast = _Xthr_zero_stub_ -/* These are added for libGL */ -#pragma weak pthread_key_create = _Xthr_zero_stub_ -#pragma weak pthread_getspecific = _Xthr_zero_stub_ -#pragma weak pthread_setspecific = _Xthr_zero_stub_ -#endif /* __GNUC__ */ -#if defined(_DECTHREADS_) || defined(linux) -#pragma weak pthread_equal = _Xthr_equal_stub_ /* See Xthreads.h! */ -int -_Xthr_equal_stub_() -{ - return(1); -} -#endif /* _DECTHREADS_ || linux */ -#endif /* USE_TIS_SUPPORT */ -#endif /* WIN32 */ -#endif /* SVR4 */ -#endif /* CTHREADS */ - -static xthread_t -_Xthr_self_stub_() -{ - static xthread_t _X_no_thread_id; - - return(_X_no_thread_id); /* defined by */ -} - -static int -_Xthr_zero_stub_() -{ - return(0); -}