Ticket #9229: glibc.diff
| File glibc.diff, 16.5 KB (added by , 13 years ago) |
|---|
-
include/iprt/alloca.h
37 37 * When we're in kernel territory it starts getting a bit more 38 38 * interesting of course... 39 39 */ 40 #if defined(IN_RING0) \41 && (defined(RT_OS_DARWIN) || defined(RT_OS_LINUX) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD))40 #ifdef IN_RING0 41 # if defined(RT_OS_DARWIN) || defined(RT_OS_LINUX) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD) || defined(__GLIBC__) 42 42 /* ASSUMES GNU C */ 43 # define alloca(cb) __builtin_alloca(cb) 43 # define alloca(cb) __builtin_alloca(cb) 44 # else 45 # include <stdlib.h> 46 # include <malloc.h> 47 # endif 44 48 45 49 #else 46 50 # include <stdlib.h> 47 # if !defined(RT_OS_DARWIN) && !defined(RT_OS_FREEBSD) 51 # if !defined(RT_OS_DARWIN) && !defined(RT_OS_FREEBSD) && !defined(__GLIBC__) 48 52 # include <malloc.h> 49 53 # endif 50 54 # ifdef RT_OS_SOLARIS -
src/VBox/Devices/Serial/DrvHostSerial.cpp
33 33 #include <iprt/semaphore.h> 34 34 #include <iprt/uuid.h> 35 35 36 #if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD) 36 #if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD) || defined(__GLIBC__) 37 37 # include <errno.h> 38 38 # ifdef RT_OS_SOLARIS 39 39 # include <sys/termios.h> … … 101 101 /** the device path */ 102 102 char *pszDevicePath; 103 103 104 #if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD) 104 #if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD) || defined(__GLIBC__) 105 105 /** the device handle */ 106 106 RTFILE hDeviceFile; 107 107 # ifdef RT_OS_DARWIN … … 194 194 static DECLCALLBACK(int) drvHostSerialSetParameters(PPDMICHARCONNECTOR pInterface, unsigned Bps, char chParity, unsigned cDataBits, unsigned cStopBits) 195 195 { 196 196 PDRVHOSTSERIAL pThis = PDMICHAR_2_DRVHOSTSERIAL(pInterface); 197 #if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD) 197 #if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD) || defined(__GLIBC__) 198 198 struct termios *termiosSetup; 199 199 int baud_rate; 200 200 #elif defined(RT_OS_WINDOWS) … … 483 483 { 484 484 /* copy the send queue so we get a linear buffer with the maximal size. */ 485 485 uint8_t ch = pThis->u8SendByte; 486 #if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD) 486 #if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD) || defined(__GLIBC__) 487 487 488 488 size_t cbWritten; 489 489 rc = RTFileWrite(pThis->hDeviceFile, &ch, 1, &cbWritten); … … 680 680 } 681 681 cbRemaining = cbRead; 682 682 683 #elif defined(RT_OS_LINUX) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD) 683 #elif defined(RT_OS_LINUX) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD) || defined(__GLIBC__) 684 684 685 685 size_t cbRead; 686 686 struct pollfd aFDs[2]; … … 845 845 static DECLCALLBACK(int) drvHostSerialWakeupRecvThread(PPDMDRVINS pDrvIns, PPDMTHREAD /*pThread*/) 846 846 { 847 847 PDRVHOSTSERIAL pThis = PDMINS_2_DATA(pDrvIns, PDRVHOSTSERIAL); 848 #if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD) 848 #if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD) || defined(__GLIBC__) 849 849 size_t cbIgnored; 850 850 return RTPipeWrite(pThis->hWakeupPipeW, "", 1, &cbIgnored); 851 851 … … 858 858 #endif 859 859 } 860 860 861 #if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD) 861 #if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD) || defined(__GLIBC__) 862 862 /* -=-=-=-=- Monitor thread -=-=-=-=- */ 863 863 864 864 /** … … 978 978 { 979 979 PDRVHOSTSERIAL pThis = PDMICHAR_2_DRVHOSTSERIAL(pInterface); 980 980 981 #if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD) 981 #if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD) || defined(__GLIBC__) 982 982 int modemStateSet = 0; 983 983 int modemStateClear = 0; 984 984 … … 1026 1026 { 1027 1027 PDRVHOSTSERIAL pThis = PDMICHAR_2_DRVHOSTSERIAL(pInterface); 1028 1028 1029 #if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD) 1029 #if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD) || defined(__GLIBC__) 1030 1030 if (fBreak) 1031 1031 ioctl(RTFileToNative(pThis->hDeviceFile), TIOCSBRK); 1032 1032 else … … 1063 1063 pThis->SendSem = NIL_RTSEMEVENT; 1064 1064 1065 1065 int rc; 1066 #if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD) 1066 #if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD) || defined(__GLIBC__) 1067 1067 1068 1068 rc = RTPipeClose(pThis->hWakeupPipeW); AssertRC(rc); 1069 1069 pThis->hWakeupPipeW = NIL_RTPIPE; … … 1113 1113 /* 1114 1114 * Init basic data members and interfaces. 1115 1115 */ 1116 #if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD) 1116 #if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD) || defined(__GLIBC__) 1117 1117 pThis->hDeviceFile = NIL_RTFILE; 1118 1118 # ifdef RT_OS_DARWIN 1119 1119 pThis->hDeviceFileR = NIL_RTFILE; … … 1209 1209 { 1210 1210 case VERR_ACCESS_DENIED: 1211 1211 return PDMDrvHlpVMSetError(pDrvIns, rc, RT_SRC_POS, 1212 #if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD) 1212 #if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD) || defined(__GLIBC__) 1213 1213 N_("Cannot open host device '%s' for read/write access. Check the permissions " 1214 1214 "of that device ('/bin/ls -l %s'): Most probably you need to be member " 1215 1215 "of the device group. Make sure that you logout/login after changing " … … 1227 1227 } 1228 1228 1229 1229 /* Set to non blocking I/O */ 1230 #if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD) 1230 #if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD) || defined(__GLIBC__) 1231 1231 1232 1232 fcntl(RTFileToNative(pThis->hDeviceFile), F_SETFL, O_NONBLOCK); 1233 1233 # ifdef RT_OS_DARWIN … … 1272 1272 if (RT_FAILURE(rc)) 1273 1273 return PDMDrvHlpVMSetError(pDrvIns, rc, RT_SRC_POS, N_("HostSerial#%d cannot create send thread"), pDrvIns->iInstance); 1274 1274 1275 #if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD) 1275 #if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD) || defined(__GLIBC__) 1276 1276 /* Linux & darwin needs a separate thread which monitors the status lines. */ 1277 1277 # ifndef RT_OS_LINUX 1278 1278 ioctl(RTFileToNative(pThis->hDeviceFile), TIOCMGET, &pThis->fStatusLines); -
src/VBox/Runtime/r3/posix/utf8-posix.cpp
168 168 size_t cbOutLeft = cbOutput2; 169 169 const void *pvInputLeft = pvInput; 170 170 void *pvOutputLeft = pvOutput; 171 #if defined(RT_OS_LINUX) || (defined(RT_OS_DARWIN) && defined(_DARWIN_FEATURE_UNIX_CONFORMANCE)) /* there are different opinions about the constness of the input buffer. */171 #if defined(RT_OS_LINUX) || defined(__GLIBC__) || (defined(RT_OS_DARWIN) && defined(_DARWIN_FEATURE_UNIX_CONFORMANCE)) /* there are different opinions about the constness of the input buffer. */ 172 172 if (iconv(hIconv, (char **)&pvInputLeft, &cbInLeft, (char **)&pvOutputLeft, &cbOutLeft) != (size_t)-1) 173 173 #else 174 174 if (iconv(hIconv, (const char **)&pvInputLeft, &cbInLeft, (char **)&pvOutputLeft, &cbOutLeft) != (size_t)-1) … … 294 294 size_t cbOutLeft = cbOutput2; 295 295 const void *pvInputLeft = pvInput; 296 296 void *pvOutputLeft = pvOutput; 297 #if defined(RT_OS_LINUX) || (defined(RT_OS_DARWIN) && defined(_DARWIN_FEATURE_UNIX_CONFORMANCE)) /* there are different opinions about the constness of the input buffer. */297 #if defined(RT_OS_LINUX) || defined(__GLIBC__) || (defined(RT_OS_DARWIN) && defined(_DARWIN_FEATURE_UNIX_CONFORMANCE)) /* there are different opinions about the constness of the input buffer. */ 298 298 if (iconv(icHandle, (char **)&pvInputLeft, &cbInLeft, (char **)&pvOutputLeft, &cbOutLeft) != (size_t)-1) 299 299 #else 300 300 if (iconv(icHandle, (const char **)&pvInputLeft, &cbInLeft, (char **)&pvOutputLeft, &cbOutLeft) != (size_t)-1) -
src/VBox/Main/xml/Settings.cpp
109 109 # define VBOX_XML_PLATFORM "solaris" 110 110 #elif defined (RT_OS_WINDOWS) 111 111 # define VBOX_XML_PLATFORM "windows" 112 #elif defined (__GLIBC__) 113 # define VBOX_XML_PLATFORM "gnu" 112 114 #else 113 115 # error Unsupported platform! 114 116 #endif -
src/VBox/Main/cbinding/VBoxXPCOMCGlue.c
44 44 /******************************************************************************* 45 45 * Defined Constants And Macros * 46 46 *******************************************************************************/ 47 #if defined(__linux__) || defined(__linux_gnu__) || defined(__ sun__) || defined(__FreeBSD__)47 #if defined(__linux__) || defined(__linux_gnu__) || defined(__GLIBC__) || defined(__sun__) || defined(__FreeBSD__) 48 48 # define DYNLIB_NAME "VBoxXPCOMC.so" 49 49 #elif defined(__APPLE__) 50 50 # define DYNLIB_NAME "VBoxXPCOMC.dylib" … … 189 189 * Try the known standard locations. 190 190 */ 191 191 g_szVBoxErrMsg[0] = '\0'; 192 #if defined(__gnu__linux__) || defined(__linux__) 192 #if defined(__gnu__linux__) || defined(__linux__) || defined(__GLIBC__) 193 193 if (tryLoadOne("/opt/VirtualBox", 1) == 0) 194 194 return 0; 195 195 if (tryLoadOne("/usr/lib/virtualbox", 1) == 0) -
src/VBox/GuestHost/OpenGL/include/cr_dll.h
22 22 char *name; 23 23 #if defined(WINDOWS) 24 24 HINSTANCE hinstLib; 25 #elif defined(IRIX) || defined(IRIX64) || defined(Linux) || defined( FreeBSD) || defined(AIX) || defined(SunOS) || defined(OSF1)25 #elif defined(IRIX) || defined(IRIX64) || defined(Linux) || defined(__GLIBC__) || defined(FreeBSD) || defined(AIX) || defined(SunOS) || defined(OSF1) 26 26 void *hinstLib; 27 27 #elif defined(DARWIN) 28 28 void *hinstLib; /* void to avoid including the headers */ -
src/VBox/GuestHost/OpenGL/include/cr_timer.h
35 35 #elif defined(WINDOWS) 36 36 LARGE_INTEGER performance_counter, performance_frequency; 37 37 double one_over_frequency; 38 #elif defined( Linux ) || defined( FreeBSD ) || defined(DARWIN) || defined(AIX) || defined (SunOS) || defined(OSF1)38 #elif defined( Linux ) || defined(__GLIBC__) || defined( FreeBSD ) || defined(DARWIN) || defined(AIX) || defined (SunOS) || defined(OSF1) 39 39 struct timeval timeofday; 40 40 #endif 41 41 } CRTimer; -
src/VBox/GuestHost/OpenGL/spu_loader/glloader.py
34 34 # define SYSTEM_AGL "AGL" 35 35 # endif 36 36 #include <string.h> /* VBOX */ 37 #elif defined(IRIX) || defined(IRIX64) || defined(Linux) || defined( FreeBSD) || defined(AIX) || defined(SunOS) || defined(OSF1)37 #elif defined(IRIX) || defined(IRIX64) || defined(Linux) || defined(__GLIBC__) || defined(FreeBSD) || defined(AIX) || defined(SunOS) || defined(OSF1) 38 38 #include <string.h> 39 39 #if defined(AIX) 40 40 #define SYSTEM_GL "libGL.o" … … 143 143 * version if it exists; otherwise, we'll use /usr/lib. 144 144 */ 145 145 /*crStrcpy(system_path, "/usr/lib");*/ 146 #if defined(__linux__) && defined(__amd64__)146 #if (defined(__linux__) || defined(__GLIBC_)) && defined(__amd64__) 147 147 /*if (sizeof(void *) == 8 && FileExists("/usr/lib64", lib)) { 148 148 crStrcat(system_path, "64"); 149 149 }*/ … … 154 154 }*/ 155 155 #endif 156 156 } 157 #if !defined(__linux__) && !defined( SunOS) && !defined(__FreeBSD__)157 #if !defined(__linux__) && !defined(__GLIBC__) && !defined(SunOS) && !defined(__FreeBSD__) 158 158 crStrcat( system_path, "/" ); 159 159 #endif 160 160 #if !defined(CR_NO_GL_SYSTEM_PATH) -
src/VBox/GuestHost/OpenGL/util/dll.c
14 14 #include <string.h> 15 15 #endif 16 16 17 #if defined(IRIX) || defined(IRIX64) || defined( Linux) || defined(FreeBSD) || defined(AIX) || defined(DARWIN) || defined(SunOS) || defined(OSF1)17 #if defined(IRIX) || defined(IRIX64) || defined(__GLIBC__) || defined(FreeBSD) || defined(AIX) || defined(DARWIN) || defined(SunOS) || defined(OSF1) 18 18 #include <dlfcn.h> 19 19 #endif 20 20 … … 203 203 dll_err = "Unknown DLL type"; 204 204 break; 205 205 }; 206 #elif defined(IRIX) || defined(IRIX64) || defined( Linux) || defined(FreeBSD) || defined(AIX) || defined(SunOS) || defined(OSF1)206 #elif defined(IRIX) || defined(IRIX64) || defined(__GLIBC__) || defined(FreeBSD) || defined(AIX) || defined(SunOS) || defined(OSF1) 207 207 if (resolveGlobal) 208 208 dll->hinstLib = dlopen( dllname, RTLD_LAZY | RTLD_GLOBAL ); 209 209 else … … 256 256 257 257 return (CRDLLFunc) NSAddressOfSymbol( nssym ); 258 258 259 #elif defined(IRIX) || defined(IRIX64) || defined( Linux) || defined(FreeBSD) || defined(AIX) || defined(SunOS) || defined(OSF1)259 #elif defined(IRIX) || defined(IRIX64) || defined(__GLIBC__) || defined(FreeBSD) || defined(AIX) || defined(SunOS) || defined(OSF1) 260 260 return (CRDLLFunc) dlsym( dll->hinstLib, symname ); 261 261 #else 262 262 #error CR DLL ARCHITETECTURE … … 300 300 NSUnLinkModule( (NSModule) dll->hinstLib, 0L ); 301 301 break; 302 302 } 303 #elif defined(IRIX) || defined(IRIX64) || defined( Linux) || defined(FreeBSD) || defined(AIX) || defined(SunOS) || defined(OSF1)303 #elif defined(IRIX) || defined(IRIX64) || defined(__GLIBC__) || defined(FreeBSD) || defined(AIX) || defined(SunOS) || defined(OSF1) 304 304 /* 305 305 * Unloading Nvidia's libGL will crash VirtualBox later during shutdown. 306 306 * Therefore we will skip unloading it. It will be unloaded later anway -
src/VBox/GuestHost/OpenGL/util/timer.c
35 35 #elif defined( WINDOWS ) 36 36 QueryPerformanceCounter( &t->performance_counter ); 37 37 return ((double) t->performance_counter.QuadPart)*t->one_over_frequency; 38 #elif defined( Linux ) || defined( FreeBSD ) || defined(DARWIN) || defined(AIX) || defined(SunOS) || defined(OSF1)38 #elif defined( Linux ) || defined(__GLIBC__) || defined( FreeBSD ) || defined(DARWIN) || defined(AIX) || defined(SunOS) || defined(OSF1) 39 39 gettimeofday( &t->timeofday, NULL ); 40 40 return t->timeofday.tv_sec + t->timeofday.tv_usec / 1000000.0; 41 41 #else -
src/VBox/Additions/x11/VBoxClient/seamless-guest.h
43 43 }; 44 44 }; 45 45 46 #if defined(RT_OS_LINUX) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD) 46 #if defined(RT_OS_LINUX) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD) || defined(__GLIBC__) 47 47 # include "seamless-x11.h" /* for VBoxGuestSeamlessGuestImpl */ 48 48 #else 49 49 # error Port me

