Changeset 3666 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Jul 17, 2007 6:33:02 AM (18 years ago)
- svn:sync-xref-src-repo-rev:
- 22942
- Location:
- trunk/src/VBox/Devices
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DevIchAc97.cpp
r3214 r3666 285 285 PDMDevHlpPhysRead (pDevIns, r->bdbar + r->civ * 8, b, sizeof(b)); 286 286 r->bd_valid = 1; 287 #if !defined( __X86__) && !defined(__AMD64__)287 #if !defined(RT_ARCH_X86) && !defined(RT_ARCH_AMD64) 288 288 #error Please adapt the code (audio buffers are little endian)! 289 289 #else … … 1680 1680 ac97Reset(pDevIns); 1681 1681 1682 #ifndef __DARWIN__/* coreaudio doesn't supply these. */1682 #ifndef RT_OS_DARWIN /* coreaudio doesn't supply these. */ 1683 1683 if (!s->voice_pi) 1684 1684 LogRel(("AC97: WARNING: Unable to open PCM IN!\n")); … … 1705 1705 "with the consequence that no sound is audible.")); 1706 1706 } 1707 #ifndef __DARWIN__1707 #ifndef RT_OS_DARWIN 1708 1708 else if (!s->voice_pi || !s->voice_po || !s->voice_mc) 1709 1709 { -
trunk/src/VBox/Devices/Audio/audio.c
r3214 r3666 43 43 #include "audio_int.h" 44 44 45 #ifdef __WIN__45 #ifdef RT_OS_WINDOWS 46 46 #define strcasecmp stricmp 47 47 #endif … … 63 63 64 64 static struct audio_driver *drvtab[] = { 65 #ifdef __LINUX__65 #ifdef RT_OS_LINUX 66 66 &oss_audio_driver, 67 67 #ifdef VBOX_WITH_ALSA … … 69 69 #endif 70 70 #endif 71 #ifdef __DARWIN__71 #ifdef RT_OS_DARWIN 72 72 &coreaudio_audio_driver, 73 73 #endif 74 #ifdef __WIN__74 #ifdef RT_OS_WINDOWS 75 75 &dsound_audio_driver, 76 76 #endif -
trunk/src/VBox/Devices/Builtins.cpp
r3648 r3666 161 161 return rc; 162 162 #endif 163 #if defined( __DARWIN__) || defined(__LINUX__) || defined(__WIN__)163 #if defined(RT_OS_DARWIN) || defined(RT_OS_LINUX) || defined(RT_OS_WINDOWS) 164 164 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvHostDVD); 165 165 if (VBOX_FAILURE(rc)) 166 166 return rc; 167 167 #endif 168 #if defined( __LINUX__) || defined(__WIN__)168 #if defined(RT_OS_LINUX) || defined(RT_OS_WINDOWS) 169 169 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvHostFloppy); 170 170 if (VBOX_FAILURE(rc)) … … 177 177 if (VBOX_FAILURE(rc)) 178 178 return rc; 179 #if defined( __WIN__) || defined(__LINUX__)179 #if defined(RT_OS_WINDOWS) || defined(RT_OS_LINUX) 180 180 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvHostHDD); 181 181 if (VBOX_FAILURE(rc)) … … 195 195 return rc; 196 196 #endif 197 #if defined(__L4ENV__) || defined( __LINUX__) || defined(__WIN__)197 #if defined(__L4ENV__) || defined(RT_OS_LINUX) || defined(RT_OS_WINDOWS) 198 198 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvHostInterface); 199 199 if (VBOX_FAILURE(rc)) … … 228 228 #endif 229 229 230 #if defined( __LINUX__)230 #if defined(RT_OS_LINUX) 231 231 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvHostParallel); 232 232 if (VBOX_FAILURE(rc)) -
trunk/src/VBox/Devices/Network/DevPCNet.cpp
r3654 r3666 365 365 #define CSR_PROM(S) !!((S)->aCSR[15] & 0x8000) /**< Promiscuous Mode */ 366 366 367 #if !defined( __X86__) && !defined(__AMD64__)367 #if !defined(RT_ARCH_X86) && !defined(RT_ARCH_AMD64) 368 368 #error fix macros (and more in this file) for big-endian machines 369 369 #endif … … 895 895 struct ether_header *hdr = (struct ether_header *)buf; 896 896 int result; 897 #if (defined( __X86__) || defined(__AMD64__)) && !defined(PCNET_DEBUG_MATCH)897 #if (defined(RT_ARCH_X86) || defined(RT_ARCH_AMD64)) && !defined(PCNET_DEBUG_MATCH) 898 898 result = !CSR_DRCVPA(pData) && !memcmp(hdr->ether_dhost, pData->aCSR + 12, 6); 899 899 #else … … 937 937 { 938 938 int index; 939 #if defined( __X86__) || defined(__AMD64__)939 #if defined(RT_ARCH_X86) || defined(RT_ARCH_AMD64) 940 940 index = lnc_mchash(hdr->ether_dhost) >> 26; 941 941 return ((uint8_t*)(pData->aCSR + 8))[index >> 3] & (1 << (index & 7)); … … 4244 4244 if (rc == VINF_NAT_DNS) 4245 4245 { 4246 #ifdef __LINUX__4246 #ifdef RT_OS_LINUX 4247 4247 VMSetRuntimeError(PDMDevHlpGetVM(pDevIns), false, "NoDNSforNAT", 4248 4248 N_("A Domain Name Server (DNS) for NAT networking could not be determined. Please check your /etc/resolv.conf for <tt>nameserver</tt> entries. Either add one manually (<i>man resolv.conf</i>) or ensure that your host is correctly connected to an ISP. If you ignore this warning the guest will not be able to perform nameserver lookups and it will probably observe delays if trying so")); -
trunk/src/VBox/Devices/Network/slirp/slirp.h
r1824 r3666 2 2 #define __COMMON_H__ 3 3 4 #ifdef __WIN__4 #ifdef RT_OS_WINDOWS 5 5 # include <winsock2.h> 6 6 typedef int socklen_t; … … 26 26 #include <VBox/log.h> 27 27 #include <iprt/mem.h> 28 #ifdef __WIN__28 #ifdef RT_OS_WINDOWS 29 29 # include <windows.h> 30 30 # include <io.h> -
trunk/src/VBox/Devices/Network/slirp/socket.c
r3226 r3666 592 592 (bind(s,(struct sockaddr *)&addr, sizeof(addr)) < 0) || 593 593 (listen(s,1) < 0)) { 594 #ifdef __WIN__594 #ifdef RT_OS_WINDOWS 595 595 int tmperrno = WSAGetLastError(); /* Don't clobber the real reason we failed */ 596 596 closesocket(s); -
trunk/src/VBox/Devices/PC/DevRTC.cpp
r3477 r3666 114 114 struct tm current_tm; 115 115 #if HC_ARCH_BITS == 64 && GC_ARCH_BITS == 32 && IN_GC 116 # if !defined( __WIN__)116 # if !defined(RT_OS_WINDOWS) 117 117 uint32_t Alignment1[3]; 118 118 # endif -
trunk/src/VBox/Devices/PC/DrvACPI.cpp
r2981 r3666 25 25 #define LOG_GROUP LOG_GROUP_DRV_ACPI 26 26 27 #ifdef __WIN__27 #ifdef RT_OS_WINDOWS 28 28 #include <windows.h> 29 29 #endif … … 38 38 #include <iprt/string.h> 39 39 40 #ifdef __LINUX__40 #ifdef RT_OS_LINUX 41 41 #include <iprt/string.h> 42 42 #include <sys/types.h> … … 99 99 PDMACPIPOWERSOURCE *pPowerSource) 100 100 { 101 #if defined( __WIN__)101 #if defined(RT_OS_WINDOWS) 102 102 SYSTEM_POWER_STATUS powerStatus; 103 103 if (GetSystemPowerStatus(&powerStatus)) … … 127 127 *pPowerSource = PDM_ACPI_POWER_SOURCE_UNKNOWN; 128 128 } 129 #elif defined ( __LINUX__) /* !__WIN__*/129 #elif defined (RT_OS_LINUX) /* !RT_OS_WINDOWS */ 130 130 DIR *dfd; 131 131 struct dirent *dp; … … 183 183 fclose(statusFile); 184 184 } 185 #else /* ! __LINUX__either - what could this be? */185 #else /* !RT_OS_LINUX either - what could this be? */ 186 186 *pPowerSource = PDM_ACPI_POWER_SOURCE_OUTLET; 187 #endif /* ! __WIN__*/187 #endif /* !RT_OS_WINDOWS */ 188 188 return VINF_SUCCESS; 189 189 } … … 203 203 *pu32PresentRate = ~0; /* present rate is unknown */ 204 204 205 #if defined( __WIN__)205 #if defined(RT_OS_WINDOWS) 206 206 SYSTEM_POWER_STATUS powerStatus; 207 207 if (GetSystemPowerStatus(&powerStatus)) … … 228 228 GetLastError())); 229 229 } 230 #elif defined( __LINUX__)230 #elif defined(RT_OS_LINUX) 231 231 DIR *dfd; 232 232 struct dirent *dp; … … 417 417 *pu32PresentRate = (uint32_t)(((float)presentRateTotal / (float)maxCapacityTotal) * 1000); 418 418 } 419 #endif /* __LINUX__*/419 #endif /* RT_OS_LINUX */ 420 420 return VINF_SUCCESS; 421 421 } -
trunk/src/VBox/Devices/Parallel/DrvHostParallel.cpp
r3649 r3666 33 33 #include <iprt/semaphore.h> 34 34 35 #ifdef __LINUX__35 #ifdef RT_OS_LINUX 36 36 #include <sys/ioctl.h> 37 37 #include <sys/types.h> -
trunk/src/VBox/Devices/Serial/DrvNamedPipe.cpp
r2981 r3666 41 41 #include "Builtins.h" 42 42 43 #ifdef __WIN__43 #ifdef RT_OS_WINDOWS 44 44 #include <windows.h> 45 #else /* ! __WIN__*/45 #else /* !RT_OS_WINDOWS */ 46 46 #include <errno.h> 47 47 #include <unistd.h> … … 49 49 #include <sys/socket.h> 50 50 #include <sys/un.h> 51 #endif /* ! __WIN__*/51 #endif /* !RT_OS_WINDOWS */ 52 52 53 53 /******************************************************************************* … … 77 77 /** Flag whether VirtualBox represents the server or client side. */ 78 78 bool fIsServer; 79 #ifdef __WIN__79 #ifdef RT_OS_WINDOWS 80 80 /* File handle of the named pipe. */ 81 81 RTFILE NamedPipe; … … 86 86 /* Listen thread wakeup semaphore */ 87 87 RTSEMEVENT ListenSem; 88 #else /* ! __WIN__*/88 #else /* !RT_OS_WINDOWS */ 89 89 /** Socket handle of the local socket for server. */ 90 90 RTSOCKET LocalSocketServer; 91 91 /** Socket handle of the local socket. */ 92 92 RTSOCKET LocalSocket; 93 #endif /* ! __WIN__*/93 #endif /* !RT_OS_WINDOWS */ 94 94 /** Thread for listening for new connections. */ 95 95 RTTHREAD ListenThread; … … 112 112 113 113 Assert(pvBuf); 114 #ifdef __WIN__114 #ifdef RT_OS_WINDOWS 115 115 if (pData->NamedPipe != NIL_RTFILE) 116 116 { … … 172 172 *cbRead = (size_t)cbReallyRead; 173 173 } 174 #else /* ! __WIN__*/174 #else /* !RT_OS_WINDOWS */ 175 175 if (pData->LocalSocket != NIL_RTSOCKET) 176 176 { … … 190 190 *cbRead = cbReallyRead; 191 191 } 192 #endif /* ! __WIN__*/192 #endif /* !RT_OS_WINDOWS */ 193 193 else 194 194 { … … 210 210 211 211 Assert(pvBuf); 212 #ifdef __WIN__212 #ifdef RT_OS_WINDOWS 213 213 if (pData->NamedPipe != NIL_RTFILE) 214 214 { … … 262 262 *cbWrite = cbWritten; 263 263 } 264 #else /* ! __WIN__*/264 #else /* !RT_OS_WINDOWS */ 265 265 if (pData->LocalSocket != NIL_RTSOCKET) 266 266 { … … 280 280 *cbWrite = cbWritten; 281 281 } 282 #endif /* ! __WIN__*/282 #endif /* !RT_OS_WINDOWS */ 283 283 284 284 LogFlow(("%s: returns %Vrc\n", __FUNCTION__, rc)); … … 325 325 PDRVNAMEDPIPE pData = (PDRVNAMEDPIPE)pvUser; 326 326 int rc = VINF_SUCCESS; 327 #ifdef __WIN__327 #ifdef RT_OS_WINDOWS 328 328 RTFILE NamedPipe = pData->NamedPipe; 329 329 HANDLE hEvent = CreateEvent(NULL, TRUE, FALSE, 0); … … 332 332 while (RT_LIKELY(!pData->fShutdown)) 333 333 { 334 #ifdef __WIN__334 #ifdef RT_OS_WINDOWS 335 335 OVERLAPPED overlapped; 336 336 … … 369 369 } 370 370 } 371 #else /* ! __WIN__*/371 #else /* !RT_OS_WINDOWS */ 372 372 if (listen(pData->LocalSocketServer, 0) == -1) 373 373 { … … 393 393 pData->LocalSocket = s; 394 394 } 395 #endif /* ! __WIN__*/396 } 397 398 #ifdef __WIN__395 #endif /* !RT_OS_WINDOWS */ 396 } 397 398 #ifdef RT_OS_WINDOWS 399 399 CloseHandle(hEvent); 400 400 #endif … … 425 425 pData->pszLocation = NULL; 426 426 pData->fIsServer = false; 427 #ifdef __WIN__427 #ifdef RT_OS_WINDOWS 428 428 pData->NamedPipe = NIL_RTFILE; 429 #else /* ! __WIN__*/429 #else /* !RT_OS_WINDOWS */ 430 430 pData->LocalSocketServer = NIL_RTSOCKET; 431 431 pData->LocalSocket = NIL_RTSOCKET; 432 #endif /* ! __WIN__*/432 #endif /* !RT_OS_WINDOWS */ 433 433 pData->ListenThread = NIL_RTTHREAD; 434 434 pData->fShutdown = false; … … 463 463 pData->fIsServer = fIsServer; 464 464 465 #ifdef __WIN__465 #ifdef RT_OS_WINDOWS 466 466 if (fIsServer) 467 467 { … … 494 494 pData->OverlappedWrite.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL); 495 495 pData->OverlappedRead.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL); 496 #else /* ! __WIN__*/496 #else /* !RT_OS_WINDOWS */ 497 497 int s; 498 498 struct sockaddr_un addr; … … 523 523 pData->LocalSocket = s; 524 524 } 525 #endif /* ! __WIN__*/525 #endif /* !RT_OS_WINDOWS */ 526 526 527 527 out: … … 579 579 pData->fShutdown = true; 580 580 581 #ifdef __WIN__581 #ifdef RT_OS_WINDOWS 582 582 if (pData->NamedPipe != NIL_RTFILE) 583 583 { … … 594 594 RTSemEventSignal(pData->ListenSem); 595 595 RTSemEventDestroy(pData->ListenSem); 596 #else /* ! __WIN__*/596 #else /* !RT_OS_WINDOWS */ 597 597 if (pData->fIsServer) 598 598 { … … 607 607 close(pData->LocalSocket); 608 608 } 609 #endif /* ! __WIN__*/609 #endif /* !RT_OS_WINDOWS */ 610 610 } 611 611 -
trunk/src/VBox/Devices/Storage/DrvHostBase.cpp
r3538 r3666 26 26 *******************************************************************************/ 27 27 #define LOG_GROUP LOG_GROUP_DRV_HOST_BASE 28 #ifdef __DARWIN__28 #ifdef RT_OS_DARWIN 29 29 # include <mach/mach.h> 30 30 # include <Carbon/Carbon.h> … … 41 41 /* Nothing special requires... yeah, right. */ 42 42 43 #elif defined( __LINUX__)43 #elif defined(RT_OS_LINUX) 44 44 # include <sys/ioctl.h> 45 45 # include <sys/fcntl.h> 46 46 # include <errno.h> 47 47 48 #elif defined( __WIN__)48 #elif defined(RT_OS_WINDOWS) 49 49 # define WIN32_NO_STATUS 50 50 # include <Windows.h> … … 134 134 */ 135 135 int rc; 136 #ifdef __DARWIN__136 #ifdef RT_OS_DARWIN 137 137 if ( pThis->fMediaPresent 138 138 && pThis->ppScsiTaskDI … … 142 142 #endif 143 143 { 144 #ifdef __DARWIN__144 #ifdef RT_OS_DARWIN 145 145 /* 146 146 * Issue a READ(12) request. … … 211 211 if (pThis->fMediaPresent) 212 212 { 213 #ifdef __DARWIN__213 #ifdef RT_OS_DARWIN 214 214 /** @todo write support... */ 215 215 rc = VERR_WRITE_PROTECT; … … 256 256 if (pThis->fMediaPresent) 257 257 { 258 #ifdef __DARWIN__258 #ifdef RT_OS_DARWIN 259 259 rc = VINF_SUCCESS; 260 260 /** @todo scsi device buffer flush... */ … … 561 561 /* -=-=-=-=- poller thread -=-=-=-=- */ 562 562 563 #ifdef __DARWIN__563 #ifdef RT_OS_DARWIN 564 564 /** The runloop input source name for the disk arbitration events. */ 565 565 #define MY_RUN_LOOP_MODE CFSTR("drvHostBaseDA") … … 734 734 } 735 735 } 736 #endif /* __DARWIN__*/736 #endif /* RT_OS_DARWIN */ 737 737 738 738 … … 745 745 static int drvHostBaseOpen(PDRVHOSTBASE pThis, PRTFILE pFileDevice, bool fReadOnly) 746 746 { 747 #ifdef __DARWIN__747 #ifdef RT_OS_DARWIN 748 748 /* Darwin is kind of special... */ 749 749 Assert(!pFileDevice); NOREF(pFileDevice); … … 923 923 return rc; 924 924 925 #elif defined( __LINUX__)925 #elif defined(RT_OS_LINUX) 926 926 /** @todo we've got RTFILE_O_NON_BLOCK now. Change the code to use RTFileOpen. */ 927 927 int FileDevice = open(pThis->pszDeviceOpen, (pThis->fReadOnlyConfig ? O_RDONLY : O_RDWR) | O_NONBLOCK); … … 950 950 static int drvHostBaseReopen(PDRVHOSTBASE pThis) 951 951 { 952 #ifndef __DARWIN__/* Only *one* open for darwin. */952 #ifndef RT_OS_DARWIN /* Only *one* open for darwin. */ 953 953 LogFlow(("%s-%d: drvHostBaseReopen: '%s'\n", pThis->pDrvIns->pDrvReg->szDriverName, pThis->pDrvIns->iInstance, pThis->pszDeviceOpen)); 954 954 … … 976 976 RTFileClose(pThis->FileDevice); 977 977 pThis->FileDevice = FileDevice; 978 #endif /* ! __DARWIN__*/978 #endif /* !RT_OS_DARWIN */ 979 979 return VINF_SUCCESS; 980 980 } … … 990 990 static int drvHostBaseGetMediaSize(PDRVHOSTBASE pThis, uint64_t *pcb) 991 991 { 992 #ifdef __DARWIN__992 #ifdef RT_OS_DARWIN 993 993 /* 994 994 * Try a READ_CAPACITY command... … … 1019 1019 return rc; 1020 1020 1021 #elif defined( __WIN__)1021 #elif defined(RT_OS_WINDOWS) 1022 1022 /* use NT api, retry a few times if the media is being verified. */ 1023 1023 IO_STATUS_BLOCK IoStatusBlock = {0}; … … 1054 1054 1055 1055 1056 #ifdef __DARWIN__1056 #ifdef RT_OS_DARWIN 1057 1057 /** 1058 1058 * Execute a SCSI command. … … 1090 1090 *pcbBuf = 0; 1091 1091 1092 # ifdef __DARWIN__1092 # ifdef RT_OS_DARWIN 1093 1093 Assert(pThis->ppScsiTaskDI); 1094 1094 … … 1227 1227 1228 1228 1229 #ifdef __WIN__1229 #ifdef RT_OS_WINDOWS 1230 1230 1231 1231 /** … … 1284 1284 } 1285 1285 1286 #endif /* __WIN__*/1286 #endif /* RT_OS_WINDOWS */ 1287 1287 1288 1288 … … 1299 1299 LogFlow(("%s-%d: drvHostBaseMediaThread: ThreadSelf=%p pvUser=%p\n", 1300 1300 pThis->pDrvIns->pDrvReg->szDriverName, pThis->pDrvIns->iInstance, ThreadSelf, pvUser)); 1301 #ifdef __WIN__1301 #ifdef RT_OS_WINDOWS 1302 1302 static WNDCLASS s_classDeviceChange = {0}; 1303 1303 static ATOM s_hAtomDeviceChange = 0; … … 1352 1352 Assert(!pThis->hwndDeviceChange); 1353 1353 1354 #else /* ! __WIN__*/1354 #else /* !RT_OS_WINDOWS */ 1355 1355 bool fFirst = true; 1356 1356 int cRetries = 10; … … 1396 1396 } 1397 1397 1398 #endif /* ! __WIN__*/1398 #endif /* !RT_OS_WINDOWS */ 1399 1399 1400 1400 /* (Don't clear the thread handle here, the destructor thread is using it to wait.) */ … … 1450 1450 do 1451 1451 { 1452 #ifdef __WIN__1452 #ifdef RT_OS_WINDOWS 1453 1453 if (pThis->hwndDeviceChange) 1454 1454 PostMessage(pThis->hwndDeviceChange, WM_CLOSE, 0, 0); /* default win proc will destroy the window */ … … 1466 1466 * Unlock the drive if we've locked it or we're in passthru mode. 1467 1467 */ 1468 #ifdef __DARWIN__1468 #ifdef RT_OS_DARWIN 1469 1469 if ( ( pThis->fLocked 1470 1470 || pThis->IBlock.pfnSendCmd) … … 1485 1485 * Cleanup the other resources. 1486 1486 */ 1487 #ifdef __WIN__1487 #ifdef RT_OS_WINDOWS 1488 1488 if (pThis->hwndDeviceChange) 1489 1489 { … … 1500 1500 #endif 1501 1501 1502 #ifdef __DARWIN__1502 #ifdef RT_OS_DARWIN 1503 1503 /* 1504 1504 * The unclaiming doesn't seem to mean much, the DVD is actaully … … 1598 1598 pThis->fKeepInstance = false; 1599 1599 pThis->ThreadPoller = NIL_RTTHREAD; 1600 #ifdef __DARWIN__1600 #ifdef RT_OS_DARWIN 1601 1601 pThis->MasterPort = NULL; 1602 1602 pThis->ppMMCDI = NULL; … … 1736 1736 1737 1737 /* name to open & watch for */ 1738 #ifdef __WIN__1738 #ifdef RT_OS_WINDOWS 1739 1739 int iBit = toupper(pThis->pszDevice[0]) - 'A'; 1740 1740 if ( iBit > 'Z' - 'A' … … 1798 1798 * Verify type. 1799 1799 */ 1800 #ifdef __WIN__1800 #ifdef RT_OS_WINDOWS 1801 1801 UINT uDriveType = GetDriveType(pThis->pszDevice); 1802 1802 switch (pThis->enmType) … … 1833 1833 * Open the device. 1834 1834 */ 1835 #ifdef __DARWIN__1835 #ifdef RT_OS_DARWIN 1836 1836 rc = drvHostBaseOpen(pThis, NULL, pThis->fReadOnlyConfig); 1837 1837 #else … … 1841 1841 { 1842 1842 char *pszDevice = pThis->pszDevice; 1843 #ifndef __DARWIN__1843 #ifndef RT_OS_DARWIN 1844 1844 char szPathReal[256]; 1845 1845 if ( RTPathExists(pszDevice) … … 1859 1859 case VERR_ACCESS_DENIED: 1860 1860 return PDMDrvHlpVMSetError(pDrvIns, rc, RT_SRC_POS, 1861 #ifdef __LINUX__1861 #ifdef RT_OS_LINUX 1862 1862 N_("Cannot open host device '%s' for %s access. Check the permissions " 1863 1863 "of that device ('/bin/ls -l %s'): Most probably you need to be member " … … 1882 1882 } 1883 1883 } 1884 #ifdef __WIN__1884 #ifdef RT_OS_WINDOWS 1885 1885 if (VBOX_SUCCESS(src)) 1886 1886 DRVHostBaseMediaPresent(pThis); … … 1901 1901 } 1902 1902 1903 #ifndef __WIN__1903 #ifndef RT_OS_WINDOWS 1904 1904 if (VBOX_SUCCESS(src)) 1905 1905 { … … 1938 1938 rc = RTThreadUserWait(pThis->ThreadPoller, 10000); 1939 1939 AssertRC(rc); 1940 #ifdef __WIN__1940 #ifdef RT_OS_WINDOWS 1941 1941 if (!pThis->hwndDeviceChange) 1942 1942 return VERR_GENERAL_FAILURE; -
trunk/src/VBox/Devices/Storage/DrvHostBase.h
r3113 r3666 78 78 * This is invalid if no drive is in the drive. */ 79 79 uint64_t volatile cbSize; 80 #ifndef __DARWIN__80 #ifndef RT_OS_DARWIN 81 81 /** The filehandle of the device. */ 82 82 RTFILE FileDevice; … … 85 85 /** Handle of the poller thread. */ 86 86 RTTHREAD ThreadPoller; 87 #ifndef __WIN__87 #ifndef RT_OS_WINDOWS 88 88 /** Event semaphore the thread will wait on. */ 89 89 RTSEMEVENT EventPoller; … … 108 108 uint32_t cLogRelErrors; 109 109 110 #ifdef __DARWIN__110 #ifdef RT_OS_DARWIN 111 111 /** The master port. */ 112 112 mach_port_t MasterPort; … … 123 123 #endif 124 124 125 #ifdef __WIN__125 #ifdef RT_OS_WINDOWS 126 126 /** Handle to the window we use to catch the device change broadcast messages. */ 127 127 volatile HWND hwndDeviceChange; … … 169 169 void DRVHostBaseMediaNotPresent(PDRVHOSTBASE pThis); 170 170 DECLCALLBACK(void) DRVHostBaseDestruct(PPDMDRVINS pDrvIns); 171 #ifdef __DARWIN__171 #ifdef RT_OS_DARWIN 172 172 DECLCALLBACK(int) DRVHostBaseScsiCmd(PDRVHOSTBASE pThis, const uint8_t *pbCmd, size_t cbCmd, PDMBLOCKTXDIR enmTxDir, 173 173 void *pvBuf, size_t *pcbBuf, uint8_t *pbSense, size_t cbSense, uint32_t cTimeoutMillies); -
trunk/src/VBox/Devices/Storage/DrvHostDVD.cpp
r3113 r3666 26 26 *******************************************************************************/ 27 27 #define LOG_GROUP LOG_GROUP_DRV_HOST_DVD 28 #ifdef __DARWIN__28 #ifdef RT_OS_DARWIN 29 29 # include <mach/mach.h> 30 30 # include <Carbon/Carbon.h> … … 40 40 /* nothing (yet). */ 41 41 42 #elif defined __LINUX__42 #elif defined RT_OS_LINUX 43 43 # include <sys/ioctl.h> 44 44 /* This is a hack to work around conflicts between these linux kernel headers … … 55 55 # define USE_MEDIA_POLLING 56 56 57 #elif defined( __WIN__)57 #elif defined(RT_OS_WINDOWS) 58 58 # include <Windows.h> 59 59 # include <winioctl.h> … … 105 105 * Eject the disc. 106 106 */ 107 #ifdef __DARWIN__107 #ifdef RT_OS_DARWIN 108 108 uint8_t abCmd[16] = 109 109 { … … 113 113 rc = DRVHostBaseScsiCmd(pThis, abCmd, 6, PDMBLOCKTXDIR_NONE, NULL, NULL, NULL, 0, 0); 114 114 115 #elif defined( __LINUX__)115 #elif defined(RT_OS_LINUX) 116 116 rc = ioctl(pThis->FileDevice, CDROMEJECT, 0); 117 117 if (rc < 0) … … 125 125 } 126 126 127 #elif defined( __WIN__)127 #elif defined(RT_OS_WINDOWS) 128 128 RTFILE FileDevice = pThis->FileDevice; 129 129 if (FileDevice == NIL_RTFILE) /* obsolete crap */ … … 180 180 static DECLCALLBACK(int) drvHostDvdDoLock(PDRVHOSTBASE pThis, bool fLock) 181 181 { 182 #ifdef __DARWIN__182 #ifdef RT_OS_DARWIN 183 183 uint8_t abCmd[16] = 184 184 { … … 188 188 int rc = DRVHostBaseScsiCmd(pThis, abCmd, 6, PDMBLOCKTXDIR_NONE, NULL, NULL, NULL, 0, 0); 189 189 190 #elif defined( __LINUX__)190 #elif defined(RT_OS_LINUX) 191 191 int rc = ioctl(pThis->FileDevice, CDROM_LOCKDOOR, (int)fLock); 192 192 if (rc < 0) … … 200 200 } 201 201 202 #elif defined( __WIN__)202 #elif defined(RT_OS_WINDOWS) 203 203 204 204 PREVENT_MEDIA_REMOVAL PreventMediaRemoval = {fLock}; … … 226 226 227 227 228 #ifdef __LINUX__228 #ifdef RT_OS_LINUX 229 229 /** 230 230 * Get the media size. … … 244 244 245 245 } 246 #endif /* __LINUX__*/246 #endif /* RT_OS_LINUX */ 247 247 248 248 … … 256 256 * Poll for media change. 257 257 */ 258 #ifdef __DARWIN__258 #ifdef RT_OS_DARWIN 259 259 AssertReturn(pThis->ppScsiTaskDI, VERR_INTERNAL_ERROR); 260 260 … … 285 285 } 286 286 287 #elif defined( __LINUX__)287 #elif defined(RT_OS_LINUX) 288 288 bool fMediaPresent = ioctl(pThis->FileDevice, CDROM_DRIVE_STATUS, CDSL_CURRENT) == CDS_DISC_OK; 289 289 … … 309 309 * Poll for media change. 310 310 */ 311 #ifdef __DARWIN__311 #ifdef RT_OS_DARWIN 312 312 /* taken care of above. */ 313 #elif defined( __LINUX__)313 #elif defined(RT_OS_LINUX) 314 314 bool fMediaChanged = ioctl(pThis->FileDevice, CDROM_MEDIA_CHANGED, CDSL_CURRENT) == 1; 315 315 #else … … 338 338 LogFlow(("%s: cmd[0]=%#04x txdir=%d pcbBuf=%d timeout=%d\n", __FUNCTION__, pbCmd[0], enmTxDir, *pcbBuf, cTimeoutMillies)); 339 339 340 #ifdef __DARWIN__340 #ifdef RT_OS_DARWIN 341 341 /* 342 342 * Pass the request on to the internal scsi command interface. … … 357 357 rc = VERR_INTERNAL_ERROR; 358 358 359 #elif defined( __LINUX__)359 #elif defined(RT_OS_LINUX) 360 360 int direction; 361 361 struct cdrom_generic_command cgc; … … 418 418 * it's 0). So just assume that everything worked ok. */ 419 419 420 #elif defined( __WIN__)420 #elif defined(RT_OS_WINDOWS) 421 421 int direction; 422 422 struct _REQ … … 538 538 pThis->pfnPoll = NULL; 539 539 #endif 540 #ifdef __LINUX__540 #ifdef RT_OS_LINUX 541 541 pThis->pfnGetMediaSize = drvHostDvdGetMediaSize; 542 542 #endif -
trunk/src/VBox/Devices/Storage/DrvHostFloppy.cpp
r3113 r3666 26 26 *******************************************************************************/ 27 27 #define LOG_GROUP LOG_GROUP_DRV_HOST_FLOPPY 28 #ifdef __LINUX__28 #ifdef RT_OS_LINUX 29 29 # include <sys/ioctl.h> 30 30 # include <linux/fd.h> … … 32 32 # include <errno.h> 33 33 34 # elif defined( __WIN__)34 # elif defined(RT_OS_WINDOWS) 35 35 # include <windows.h> 36 36 # include <dbt.h> … … 38 38 #elif defined(__L4ENV__) 39 39 40 #else /* ! __WIN__ nor __LINUX__nor __L4ENV__ */40 #else /* !RT_OS_WINDOWS nor RT_OS_LINUX nor __L4ENV__ */ 41 41 # error "Unsupported Platform." 42 #endif /* ! __WIN__ nor __LINUX__nor __L4ENV__ */42 #endif /* !RT_OS_WINDOWS nor RT_OS_LINUX nor __L4ENV__ */ 43 43 44 44 #include <VBox/pdm.h> … … 74 74 75 75 76 #ifdef __LINUX__76 #ifdef RT_OS_LINUX 77 77 /** 78 78 * Get media size and do change processing. … … 102 102 return RTFileSeek(pThis->FileDevice, 0, RTFILE_SEEK_END, pcb); 103 103 } 104 #endif /* __LINUX__*/105 106 107 #ifdef __LINUX__104 #endif /* RT_OS_LINUX */ 105 106 107 #ifdef RT_OS_LINUX 108 108 /** 109 109 * This thread will periodically poll the Floppy for media presence. … … 146 146 return VINF_SUCCESS; 147 147 } 148 #endif /* __LINUX__*/148 #endif /* RT_OS_LINUX */ 149 149 150 150 … … 172 172 * Override stuff. 173 173 */ 174 #ifdef __LINUX__174 #ifdef RT_OS_LINUX 175 175 pThis->Base.pfnPoll = drvHostFloppyPoll; 176 176 pThis->Base.pfnGetMediaSize = drvHostFloppyGetMediaSize; -
trunk/src/VBox/Devices/Storage/DrvHostRawDisk.cpp
r3081 r3666 37 37 #include <iprt/string.h> 38 38 39 #ifdef __WIN__39 #ifdef RT_OS_WINDOWS 40 40 #include <windows.h> 41 41 #include <winioctl.h> 42 #elif __LINUX__42 #elif RT_OS_LINUX 43 43 #include <errno.h> 44 44 #include <sys/ioctl.h> … … 48 48 #include <linux/hdreg.h> 49 49 #include <linux/fs.h> 50 #endif /* ! __WIN__ && !__LINUX__*/50 #endif /* !RT_OS_WINDOWS && !RT_OS_LINUX */ 51 51 52 52 #include "Builtins.h" … … 339 339 pThis->cSectors = 0; 340 340 pThis->enmTranslation = PDMBIOSTRANSLATION_AUTO; 341 #ifdef __WIN__341 #ifdef RT_OS_WINDOWS 342 342 DISK_GEOMETRY DriveGeo; 343 343 DWORD cbDriveGeo; … … 367 367 else 368 368 rc = RTErrConvertFromWin32(GetLastError()); 369 #elif defined( __LINUX__)369 #elif defined(RT_OS_LINUX) 370 370 struct stat DevStat; 371 371 if (!fstat(pThis->HostDiskFile, &DevStat) && S_ISBLK(DevStat.st_mode))
Note:
See TracChangeset
for help on using the changeset viewer.