Index: trunk/src/VBox/Frontends/VBoxBFE/COMDefs.h
===================================================================
--- trunk/src/VBox/Frontends/VBoxBFE/COMDefs.h	(revision 3668)
+++ trunk/src/VBox/Frontends/VBoxBFE/COMDefs.h	(revision 3669)
@@ -23,5 +23,5 @@
 #define COMDefs_H
 
-#ifdef __WIN__
+#ifdef RT_OS_WINDOWS
 # include <Windows.h>
 #endif
@@ -43,5 +43,5 @@
 #define ATL_NO_VTABLE
 
-#ifndef __WIN__
+#ifndef RT_OS_WINDOWS
   typedef unsigned long  HRESULT;
   typedef unsigned long  ULONG; /// @todo 64-bit: ULONG is 32-bit.
@@ -72,5 +72,5 @@
 # define SUCCEEDED      NS_SUCCEEDED
 # define FAILED         NS_FAILED
-#endif /* !__WIN__ */
+#endif /* !RT_OS_WINDOWS */
 
 #endif
Index: trunk/src/VBox/Frontends/VBoxBFE/NetworkAdapterImpl.cpp
===================================================================
--- trunk/src/VBox/Frontends/VBoxBFE/NetworkAdapterImpl.cpp	(revision 3668)
+++ trunk/src/VBox/Frontends/VBoxBFE/NetworkAdapterImpl.cpp	(revision 3669)
@@ -137,5 +137,5 @@
 NetworkAdapter::COMSETTER(HostInterface)(INPTR BSTR hostInterface)
 {
-#ifdef __LINUX__
+#ifdef RT_OS_LINUX
     // empty strings are not allowed as path names
     if (hostInterface && !(*hostInterface))
Index: trunk/src/VBox/Frontends/VBoxBFE/NetworkAdapterImpl.h
===================================================================
--- trunk/src/VBox/Frontends/VBoxBFE/NetworkAdapterImpl.h	(revision 3668)
+++ trunk/src/VBox/Frontends/VBoxBFE/NetworkAdapterImpl.h	(revision 3669)
@@ -50,5 +50,5 @@
             : mSlot (0), mEnabled (FALSE)
             ,  mCableConnected (TRUE), mTraceEnabled (FALSE)
-#ifdef __LINUX__
+#ifdef RT_OS_LINUX
             , mTAPFD (NIL_RTFILE)
 #endif
@@ -62,5 +62,5 @@
         BOOL mTraceEnabled;
         Bstr mHostInterface;
-#ifdef __LINUX__
+#ifdef RT_OS_LINUX
         Bstr mTAPSetupApplication;
         Bstr mTAPTerminateApplication;
@@ -90,5 +90,5 @@
     STDMETHOD(COMGETTER(HostInterface))(BSTR *hostInterface);
     STDMETHOD(COMSETTER(HostInterface))(INPTR BSTR hostInterface);
-#ifdef __LINUX__
+#ifdef RT_OS_LINUX
     STDMETHOD(COMGETTER(TAPFileDescriptor))(LONG *tapFileDescriptor);
     STDMETHOD(COMSETTER(TAPFileDescriptor))(LONG tapFileDescriptor);
Index: trunk/src/VBox/Frontends/VBoxBFE/SDLConsole.cpp
===================================================================
--- trunk/src/VBox/Frontends/VBoxBFE/SDLConsole.cpp	(revision 3668)
+++ trunk/src/VBox/Frontends/VBoxBFE/SDLConsole.cpp	(revision 3669)
@@ -25,5 +25,5 @@
 *******************************************************************************/
 #define LOG_GROUP LOG_GROUP_GUI
-#ifdef __DARWIN__
+#ifdef RT_OS_DARWIN
 # include <Carbon/Carbon.h>
 # define OSType VBoxOSType
@@ -414,5 +414,5 @@
 }
 
-#if defined(__DARWIN__)
+#if defined(RT_OS_DARWIN)
 /**
  * Fallback keycode conversion using SDL symbols.
@@ -574,5 +574,5 @@
     }
 }
-#endif /* __DARWIN__ */
+#endif /* RT_OS_DARWIN */
 
 /**
@@ -675,5 +675,5 @@
     }
 
-#elif defined(__DARWIN__)
+#elif defined(RT_OS_DARWIN)
     /* This is derived partially from SDL_QuartzKeys.h and partially from testing. */
     static const uint8_t s_aMacToSet1[] =
@@ -1033,5 +1033,5 @@
 }
 
-#ifdef __DARWIN__
+#ifdef RT_OS_DARWIN
 
 __BEGIN_DECLS
@@ -1093,5 +1093,5 @@
         g_fHotKeysDisabled = enmMode == kCGSGlobalHotKeyDisable;
 }
-#endif /* __DARWIN__ */
+#endif /* RT_OS_DARWIN */
 
 /**
@@ -1100,5 +1100,5 @@
 void SDLConsole::inputGrabStart()
 {
-#ifdef __DARWIN__
+#ifdef RT_OS_DARWIN
     DisableGlobalHotKeys(true);
 #endif
@@ -1120,5 +1120,5 @@
     if (!gMouse->getNeedsHostCursor())
         SDL_ShowCursor(SDL_ENABLE);
-#ifdef __DARWIN__
+#ifdef RT_OS_DARWIN
     DisableGlobalHotKeys(false);
 #endif
@@ -1288,5 +1288,5 @@
         const uint8_t *srcShapePtr = data->shape + ((andMaskSize + 3) & ~3);
 
-#if defined (__WIN__)
+#if defined (RT_OS_WINDOWS)
 
         BITMAPV5HEADER bi;
Index: trunk/src/VBox/Frontends/VBoxBFE/SDLConsole.h
===================================================================
--- trunk/src/VBox/Frontends/VBoxBFE/SDLConsole.h	(revision 3668)
+++ trunk/src/VBox/Frontends/VBoxBFE/SDLConsole.h	(revision 3669)
@@ -26,8 +26,8 @@
 /* include this first so Windows.h get's in before our stuff. */
 #include <SDL.h>
-#ifndef __DARWIN__
+#ifndef RT_OS_DARWIN
 # include <SDL_syswm.h>
 #endif
-#if defined(__WIN__) /// @todo someone please explain why this is necessary. This breaks darwin solid.
+#if defined(RT_OS_WINDOWS) /// @todo someone please explain why this is necessary. This breaks darwin solid.
 // damn SDL redefines main!
 #undef main
Index: trunk/src/VBox/Frontends/VBoxBFE/SDLFramebuffer.cpp
===================================================================
--- trunk/src/VBox/Frontends/VBoxBFE/SDLFramebuffer.cpp	(revision 3668)
+++ trunk/src/VBox/Frontends/VBoxBFE/SDLFramebuffer.cpp	(revision 3669)
@@ -51,5 +51,5 @@
     LogFlow(("SDLFramebuffer::SDLFramebuffer\n"));
 
-#if defined (__WIN__)
+#if defined (RT_OS_WINDOWS)
     refcnt = 0;
 #endif
@@ -70,5 +70,5 @@
 #endif
 
-#ifdef __LINUX__
+#ifdef RT_OS_LINUX
     /* NOTE: we still want Ctrl-C to work, so we undo the SDL redirections */
     signal(SIGINT, SIG_DFL);
@@ -233,5 +233,5 @@
              x, y, w, h));
 
-#ifdef __LINUX__
+#ifdef RT_OS_LINUX
     /*
      * SDL does not allow us to make this call from any other
@@ -254,7 +254,7 @@
     /* in order to not flood the SDL event queue, yield the CPU */
     RTThreadYield();
-#else /* !__LINUX__ */
+#else /* !RT_OS_LINUX */
     update(x, y + mTopOffset, w, h);
-#endif /* !__LINUX__ */
+#endif /* !RT_OS_LINUX */
 
     /*
@@ -373,5 +373,5 @@
     {
         sdlFlags |= SDL_FULLSCREEN;
-#ifdef __WIN__
+#ifdef RT_OS_WINDOWS
         /* this flag causes a crash on Windows, mScreen->pixels is NULL */
         sdlFlags &= ~SDL_HWSURFACE;
@@ -419,5 +419,5 @@
 void SDLFramebuffer::update(int x, int y, int w, int h)
 {
-#ifdef __LINUX__
+#ifdef RT_OS_LINUX
     AssertMsg(mSdlNativeThread == RTThreadNativeSelf(), ("Wrong thread! SDL is not threadsafe!\n"));
 #endif
Index: trunk/src/VBox/Frontends/VBoxBFE/SDLFramebuffer.h
===================================================================
--- trunk/src/VBox/Frontends/VBoxBFE/SDLFramebuffer.h	(revision 3668)
+++ trunk/src/VBox/Frontends/VBoxBFE/SDLFramebuffer.h	(revision 3669)
@@ -100,5 +100,5 @@
     uint32_t mLabelHeight;
 #endif
-#ifdef __WIN__
+#ifdef RT_OS_WINDOWS
     long refcnt;
 #endif
Index: trunk/src/VBox/Frontends/VBoxBFE/USBProxyService.h
===================================================================
--- trunk/src/VBox/Frontends/VBoxBFE/USBProxyService.h	(revision 3668)
+++ trunk/src/VBox/Frontends/VBoxBFE/USBProxyService.h	(revision 3669)
@@ -178,5 +178,5 @@
 
 
-#if defined(__LINUX__) || defined(__L4__)
+#if defined(RT_OS_LINUX) || defined(__L4__)
 #include <stdio.h>
 
@@ -212,8 +212,8 @@
     std::string mUsbfsRoot;
 };
-#endif /* __LINUX__ */
-
-
-#ifdef __WIN__
+#endif /* RT_OS_LINUX */
+
+
+#ifdef RT_OS_WINDOWS
 /**
  * The Win32/Win64 hosted USB Proxy Service.
Index: trunk/src/VBox/Frontends/VBoxBFE/VBoxBFE.cpp
===================================================================
--- trunk/src/VBox/Frontends/VBoxBFE/VBoxBFE.cpp	(revision 3668)
+++ trunk/src/VBox/Frontends/VBoxBFE/VBoxBFE.cpp	(revision 3669)
@@ -65,5 +65,5 @@
 #include <errno.h>
 
-#if defined(__LINUX__) || defined(__L4__)
+#if defined(RT_OS_LINUX) || defined(__L4__)
 #include <fcntl.h>
 #include <net/if.h>
@@ -200,5 +200,5 @@
     PDMMAC      Mac;        /**< The mac address for the device. */
     const char *pszName;     /**< The device name of a HIF device. The name of the internal network. */
-#if 1//defined(__LINUX__)
+#if 1//defined(RT_OS_LINUX)
     bool        fHaveFd;    /**< Set if fd is valid. */
     int32_t     fd;         /**< The file descriptor of a HIF device.*/
@@ -303,5 +303,5 @@
              "  -netsniff<1-N>     Enable packet sniffer\n"
 #endif
-#ifdef __LINUX__
+#ifdef RT_OS_LINUX
              "  -tapfd<1-N> <fd>   Use existing TAP device, don't allocate\n"
 #endif
@@ -562,5 +562,5 @@
             /** @todo filename */
         }
-#ifdef __LINUX__
+#ifdef RT_OS_LINUX
         else if (strncmp(pszArg, "-tapfd", 6) == 0)
         {
@@ -573,5 +573,5 @@
             g_aNetDevs[i].fHaveFd = true;
         }
-#endif /* __LINUX__ */
+#endif /* RT_OS_LINUX */
 #ifdef VBOX_VRDP
         else if (strcmp(pszArg, "-vrdp") == 0)
@@ -686,5 +686,5 @@
     do
     {
-#if defined(__LINUX__) && defined(USE_SDL)
+#if defined(RT_OS_LINUX) && defined(USE_SDL)
         if (   machineState == VMSTATE_CREATING
             || machineState == VMSTATE_LOADING)
@@ -1479,5 +1479,5 @@
                 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg);                     UPDATE_RC();
 
-#if defined(__LINUX__)
+#if defined(RT_OS_LINUX)
                 if (g_aNetDevs[ulInstance].fHaveFd)
                 {
@@ -1490,5 +1490,5 @@
 #endif
                 {
-#if defined (__LINUX__) || defined (__L4__)
+#if defined (RT_OS_LINUX) || defined (__L4__)
                     /*
                      * Create/Open the TAP the device.
@@ -1541,5 +1541,5 @@
                     rc = CFGMR3InsertInteger(pCfg, "FileHandle", (RTFILE)tapFD);                    UPDATE_RC();
 
-#elif defined(__WIN__)
+#elif defined(RT_OS_WINDOWS)
                     /*
                      * We need the GUID too here...
@@ -1550,5 +1550,5 @@
 
 
-#else /* !__LINUX__ && !__L4__ */
+#else /* !RT_OS_LINUX && !__L4__ */
                     FatalError("Name based HIF devices not implemented yet for this host platform\n");
                     return VERR_NOT_IMPLEMENTED;
@@ -1598,9 +1598,9 @@
         rc = CFGMR3InsertString(pLunL0, "Driver",         "AUDIO");                 UPDATE_RC();
         rc = CFGMR3InsertNode(pLunL0,   "Config",         &pCfg);                   UPDATE_RC();
-#ifdef __WIN__
+#ifdef RT_OS_WINDOWS
         rc = CFGMR3InsertString(pCfg, "AudioDriver",      "winmm");                 UPDATE_RC();
-#elif defined(__DARWIN__)
+#elif defined(RT_OS_DARWIN)
         rc = CFGMR3InsertString(pCfg, "AudioDriver",      "coreaudio");             UPDATE_RC();
-#elif defined(__LINUX__)
+#elif defined(RT_OS_LINUX)
         rc = CFGMR3InsertString(pCfg, "AudioDriver",      "oss");                   UPDATE_RC();
 #elif defined(__L4ENV__)
@@ -1608,5 +1608,5 @@
 #else /* portme */
         rc = CFGMR3InsertString(pCfg, "AudioDriver",      "none");                  UPDATE_RC();
-#endif /* !__WIN__ */
+#endif /* !RT_OS_WINDOWS */
     }
 
Index: trunk/src/VBox/Frontends/VBoxSDL/Framebuffer.cpp
===================================================================
--- trunk/src/VBox/Frontends/VBoxSDL/Framebuffer.cpp	(revision 3668)
+++ trunk/src/VBox/Frontends/VBoxSDL/Framebuffer.cpp	(revision 3669)
@@ -30,5 +30,5 @@
 #include <iprt/stream.h>
 
-#ifdef __OS2__
+#ifdef RT_OS_OS2
 # undef RT_MAX
 // from <iprt/cdefs.h>
@@ -87,5 +87,5 @@
     LogFlow(("VBoxSDLFB::VBoxSDLFB\n"));
 
-#if defined (__WIN__)
+#if defined (RT_OS_WINDOWS)
     refcnt = 0;
 #endif
@@ -122,5 +122,5 @@
     AssertMsg(rc == VINF_SUCCESS, ("Error from RTCritSectInit!\n"));
 
-#ifdef __WIN__
+#ifdef RT_OS_WINDOWS
     /* default to DirectX if nothing else set */
     if (!getenv("SDL_VIDEODRIVER"))
@@ -130,5 +130,5 @@
     }
 #endif
-#ifdef __LINUX__
+#ifdef RT_OS_LINUX
     /* On some X servers the mouse is stuck inside the bottom right corner.
      * See http://wiki.clug.org.za/wiki/QEMU_mouse_not_working */
@@ -142,5 +142,5 @@
     }
 
-#ifdef __LINUX__
+#ifdef RT_OS_LINUX
     /* NOTE: we still want Ctrl-C to work, so we undo the SDL redirections */
     signal(SIGINT, SIG_DFL);
@@ -392,5 +392,5 @@
              x, y, w, h));
 
-#ifdef __LINUX__
+#ifdef RT_OS_LINUX
     /*
      * SDL does not allow us to make this call from any other thread than
@@ -406,7 +406,7 @@
     event.user.data2 = (void*)(w << 16 | h);
     PushNotifyUpdateEvent(&event);
-#else /* !__LINUX__ */
+#else /* !RT_OS_LINUX */
     update(x, y, w, h, true /* fGuestRelative */);
-#endif /* !__LINUX__ */
+#endif /* !RT_OS_LINUX */
 
     /*
@@ -796,5 +796,5 @@
 void VBoxSDLFB::update(int x, int y, int w, int h, bool fGuestRelative)
 {
-#ifdef __LINUX__
+#ifdef RT_OS_LINUX
     AssertMsg(mSdlNativeThread == RTThreadNativeSelf(), ("Wrong thread! SDL is not threadsafe!\n"));
 #endif
@@ -995,5 +995,5 @@
 void VBoxSDLFB::paintSecureLabel(int x, int y, int w, int h, bool fForce)
 {
-#ifdef __LINUX__
+#ifdef RT_OS_LINUX
     AssertMsg(mSdlNativeThread == RTThreadNativeSelf(), ("Wrong thread! SDL is not threadsafe!\n"));
 #endif
Index: trunk/src/VBox/Frontends/VBoxSDL/Framebuffer.h
===================================================================
--- trunk/src/VBox/Frontends/VBoxSDL/Framebuffer.h	(revision 3668)
+++ trunk/src/VBox/Frontends/VBoxSDL/Framebuffer.h	(revision 3669)
@@ -52,5 +52,5 @@
     virtual ~VBoxSDLFB();
 
-#ifdef __WIN__
+#ifdef RT_OS_WINDOWS
     STDMETHOD_(ULONG, AddRef)()
     {
@@ -179,5 +179,5 @@
     uint32_t mLabelHeight;
 #endif
-#ifdef __WIN__
+#ifdef RT_OS_WINDOWS
     long refcnt;
 #endif
@@ -200,5 +200,5 @@
     virtual ~VBoxSDLFBOverlay();
 
-#ifdef __WIN__
+#ifdef RT_OS_WINDOWS
     STDMETHOD_(ULONG, AddRef)()
     {
@@ -285,5 +285,5 @@
     /** Additional SDL surface used for combining the framebuffer and the overlay */
     SDL_Surface *mBlendedBits;
-#ifdef __WIN__
+#ifdef RT_OS_WINDOWS
     long refcnt;
 #endif
Index: trunk/src/VBox/Frontends/VBoxSDL/Helper.h
===================================================================
--- trunk/src/VBox/Frontends/VBoxSDL/Helper.h	(revision 3668)
+++ trunk/src/VBox/Frontends/VBoxSDL/Helper.h	(revision 3669)
@@ -24,5 +24,5 @@
 #define __H_HELPER
 
-#if defined(VBOX_WITH_XPCOM) && !defined(__DARWIN__) && !defined(__OS2__)
+#if defined(VBOX_WITH_XPCOM) && !defined(RT_OS_DARWIN) && !defined(RT_OS_OS2)
 
 /** Indicates that the XPCOM queue thread is needed for this platform. */
@@ -52,5 +52,5 @@
 void terminateXPCOMQueueThread(void);
 
-#endif /* defined(VBOX_WITH_XPCOM) && !defined(__DARWIN__) && !defined(__OS2__) */
+#endif /* defined(VBOX_WITH_XPCOM) && !defined(RT_OS_DARWIN) && !defined(RT_OS_OS2) */
 
 #endif // __H_HELPER
Index: trunk/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp
===================================================================
--- trunk/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp	(revision 3668)
+++ trunk/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp	(revision 3669)
@@ -34,5 +34,5 @@
 using namespace com;
 
-#if defined (__LINUX__)
+#if defined (RT_OS_LINUX)
 #include <X11/Xlib.h>
 #include <X11/cursorfont.h>      /* for XC_left_ptr */
@@ -185,5 +185,5 @@
 static VBoxSDLFB  *gpFrameBuffer = NULL;
 static SDL_Cursor *gpDefaultCursor = NULL;
-#ifdef __LINUX__
+#ifdef RT_OS_LINUX
 static Cursor      gpDefaultOrigX11Cursor;
 #endif
@@ -193,10 +193,10 @@
 static SDL_TimerID gSdlResizeTimer = NULL;
 
-#ifdef __LINUX__
+#ifdef RT_OS_LINUX
 static SDL_SysWMinfo gSdlInfo;
 #endif
 
 #ifdef VBOX_SECURELABEL
-#ifdef __WIN__
+#ifdef RT_OS_WINDOWS
 #define LIBSDL_TTF_NAME "SDL_ttf"
 #else
@@ -218,5 +218,5 @@
     VBoxSDLCallback()
     {
-#if defined (__WIN__)
+#if defined (RT_OS_WINDOWS)
         refcnt = 0;
 #endif
@@ -227,5 +227,5 @@
     }
 
-#ifdef __WIN__
+#ifdef RT_OS_WINDOWS
     STDMETHOD_(ULONG, AddRef)()
     {
@@ -346,5 +346,5 @@
 
 private:
-#ifdef __WIN__
+#ifdef RT_OS_WINDOWS
     long refcnt;
 #endif
@@ -361,5 +361,5 @@
     VBoxSDLConsoleCallback() : m_fIgnorePowerOffEvents(false)
     {
-#if defined (__WIN__)
+#if defined (RT_OS_WINDOWS)
         refcnt = 0;
 #endif
@@ -370,5 +370,5 @@
     }
 
-#ifdef __WIN__
+#ifdef RT_OS_WINDOWS
     STDMETHOD_(ULONG, AddRef)()
     {
@@ -570,5 +570,5 @@
 
 private:
-#ifdef __WIN__
+#ifdef RT_OS_WINDOWS
     long refcnt;
 #endif
@@ -601,5 +601,5 @@
              "  -detecthostkey           Get the hostkey identifier and modifier state\n"
              "  -hostkey <key> {<key2>} <mod> Set the host key to the values obtained using -detecthostkey\n"
-#if defined(__LINUX__) || defined(__DARWIN__) /** @todo UNIXISH_TAP stuff out of main and up to Config.kmk! */
+#if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) /** @todo UNIXISH_TAP stuff out of main and up to Config.kmk! */
              "  -tapdev<1-N> <dev>       Use existing persistent TAP device with the given name\n"
              "  -tapfd<1-N> <fd>         Use existing TAP device, don't allocate\n"
@@ -652,5 +652,5 @@
 }
 
-#ifdef __LINUX__
+#ifdef RT_OS_LINUX
 /**
  * Custom signal handler. Currently it is only used to release modifier
@@ -669,5 +669,5 @@
     }
 }
-#endif /* __LINUX__ */
+#endif /* RT_OS_LINUX */
 
 /** entry point */
@@ -684,5 +684,5 @@
     }
 
-#ifdef __LINUX__
+#ifdef RT_OS_LINUX
     /*
      * Lock keys on SDL behave different from normal keys: A KeyPress event is generated
@@ -927,5 +927,5 @@
     sysInfo->COMGETTER (NetworkAdapterCount) (&NetworkAdapterCount);
 
-#if defined(__LINUX__) || defined(__DARWIN__)
+#if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN)
     std::vector <Bstr> tapdev (NetworkAdapterCount);
     std::vector <int> tapfd (NetworkAdapterCount, 0);
@@ -1097,5 +1097,5 @@
             }
         }
-#if defined(__LINUX__) || defined(__DARWIN__)
+#if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN)
         else if (strncmp(argv[curArg], "-tapdev", 7) == 0)
         {
@@ -1124,5 +1124,5 @@
             curArg++;
         }
-#endif /* __LINUX__ || __DARWIN__ */
+#endif /* RT_OS_LINUX || RT_OS_DARWIN */
 #ifdef VBOX_VRDP
         else if (strcmp(argv[curArg], "-vrdp") == 0)
@@ -1654,5 +1654,5 @@
     consoleCallback->ignorePowerOffEvents(true);
 
-#if defined(__LINUX__) || defined(__DARWIN__)
+#if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN)
     /*
      * Do we have a TAP device name or file descriptor? If so, communicate
@@ -1691,5 +1691,5 @@
         }
     }
-#endif /* __LINUX__ || __DARWIN__ */
+#endif /* RT_OS_LINUX || RT_OS_DARWIN */
 
 #ifdef VBOX_VRDP
@@ -1780,5 +1780,5 @@
     gpDefaultCursor = SDL_GetCursor();
 
-#ifdef __LINUX__
+#ifdef RT_OS_LINUX
     /* Get Window Manager info. We only need the X11 display. */
     SDL_VERSION(&gSdlInfo.version);
@@ -1794,5 +1794,5 @@
     *(Cursor*)gpDefaultCursor->wm_cursor = XCreateFontCursor(gSdlInfo.info.x11.display, XC_left_ptr);
     SDL_SetCursor(gpDefaultCursor);
-#endif /* __LINUX__ */
+#endif /* RT_OS_LINUX */
 
     /* create a fake empty cursor */
@@ -1807,5 +1807,5 @@
      * Register our user signal handler.
      */
-#ifdef __LINUX__
+#ifdef RT_OS_LINUX
     struct sigaction sa;
     sa.sa_sigaction = signal_handler;
@@ -1813,5 +1813,5 @@
     sa.sa_flags = SA_RESTART | SA_SIGINFO;
     sigaction (SIGUSR1, &sa, NULL);
-#endif /* __LINUX__ */
+#endif /* RT_OS_LINUX */
 
     /*
@@ -2394,5 +2394,5 @@
 leave:
     LogFlow(("leaving...\n"));
-#if defined(VBOX_WITH_XPCOM) && !defined(__DARWIN__) && !defined(__OS2__)
+#if defined(VBOX_WITH_XPCOM) && !defined(RT_OS_DARWIN) && !defined(RT_OS_OS2)
     /* make sure the XPCOM event queue thread doesn't do anything harmful */
     terminateXPCOMQueueThread();
@@ -2453,12 +2453,12 @@
     if (gpDefaultCursor)
     {
-#ifdef __LINUX__
+#ifdef RT_OS_LINUX
         Cursor pDefaultTempX11Cursor = *(Cursor*)gpDefaultCursor->wm_cursor;
         *(Cursor*)gpDefaultCursor->wm_cursor = gpDefaultOrigX11Cursor;
-#endif /* __LNUX__ */
+#endif /* RT_OS_LINUX */
         SDL_SetCursor(gpDefaultCursor);
-#ifdef __LINUX__
+#ifdef RT_OS_LINUX
         XFreeCursor(gSdlInfo.info.x11.display, pDefaultTempX11Cursor);
-#endif /* __LINUX__ */
+#endif /* RT_OS_LINUX */
     }
 
@@ -2470,7 +2470,7 @@
         if (pCustomTempWMCursor)
         {
-#if defined (__WIN__)
+#if defined (RT_OS_WINDOWS)
             ::DestroyCursor(*(HCURSOR *) pCustomTempWMCursor);
-#elif defined (__LINUX__)
+#elif defined (RT_OS_LINUX)
             XFreeCursor(gSdlInfo.info.x11.display, *(Cursor *) pCustomTempWMCursor);
 #endif
@@ -2537,5 +2537,5 @@
 }
 
-#if defined(__DARWIN__)
+#if defined(RT_OS_DARWIN)
 /**
  * Fallback keycode conversion using SDL symbols.
@@ -2697,5 +2697,5 @@
     }
 }
-#endif /* __DARWIN__ */
+#endif /* RT_OS_DARWIN */
 
 /**
@@ -2710,5 +2710,5 @@
     int keycode = ev->keysym.scancode;
 
-#ifdef __LINUX__
+#ifdef RT_OS_LINUX
     // workaround for SDL keyboard translation issues on Linux
     // keycodes > 0x100 are sent as 0xe0 keycode
@@ -2807,5 +2807,5 @@
     }
 
-#elif defined(__DARWIN__)
+#elif defined(RT_OS_DARWIN)
     /* This is derived partially from SDL_QuartzKeys.h and partially from testing. */
     static const uint16_t s_aMacToSet1[] =
@@ -2980,5 +2980,5 @@
 #endif
 
-#endif /* __DARWIN__ */
+#endif /* RT_OS_DARWIN */
     return keycode;
 }
@@ -3205,5 +3205,5 @@
 }
 
-#ifdef __DARWIN__
+#ifdef RT_OS_DARWIN
 #include <Carbon/Carbon.h>
 __BEGIN_DECLS
@@ -3265,5 +3265,5 @@
         g_fHotKeysDisabled = enmMode == kCGSGlobalHotKeyDisable;
 }
-#endif /* __DARWIN__ */
+#endif /* RT_OS_DARWIN */
 
 /**
@@ -3272,5 +3272,5 @@
 static void InputGrabStart(void)
 {
-#ifdef __DARWIN__
+#ifdef RT_OS_DARWIN
     DisableGlobalHotKeys(true);
 #endif
@@ -3292,5 +3292,5 @@
     if (!gfGuestNeedsHostCursor)
         SDL_ShowCursor(SDL_ENABLE);
-#ifdef __DARWIN__
+#ifdef RT_OS_DARWIN
     DisableGlobalHotKeys(false);
 #endif
@@ -3488,5 +3488,5 @@
      */
     LONG    cPercent = 0;
-#ifndef __DARWIN__ /* don't break the other guys yet. */
+#ifndef RT_OS_DARWIN /* don't break the other guys yet. */
     for (;;)
     {
@@ -3582,5 +3582,5 @@
     sdlTimer = 0;
 
-#endif /* __DARWIN__ */
+#endif /* RT_OS_DARWIN */
 
     /*
@@ -3817,5 +3817,5 @@
 #endif
 
-#if defined (__WIN__)
+#if defined (RT_OS_WINDOWS)
 
         BITMAPV5HEADER bi;
@@ -3961,5 +3961,5 @@
             ::DeleteObject (hBitmap);
 
-#elif defined (__LINUX__)
+#elif defined (RT_OS_LINUX)
 
         XcursorImage *img = XcursorImageCreate (data->width, data->height);
@@ -4339,5 +4339,5 @@
 }
 
-#ifdef __LINUX__
+#ifdef RT_OS_LINUX
 /**
  * Special SDL_PushEvent function for NotifyUpdate events. These events may occur in bursts
@@ -4364,3 +4364,3 @@
         RTThreadYield();
 }
-#endif /* __LINUX__ */
+#endif /* RT_OS_LINUX */
Index: trunk/src/VBox/Frontends/VBoxSDL/VBoxSDL.h
===================================================================
--- trunk/src/VBox/Frontends/VBoxSDL/VBoxSDL.h	(revision 3668)
+++ trunk/src/VBox/Frontends/VBoxSDL/VBoxSDL.h	(revision 3669)
@@ -24,5 +24,5 @@
 #define __H_VBOXSDL
 
-#ifdef __WIN__ /** @todo check why we need to do this on windows. */
+#ifdef RT_OS_WINDOWS /** @todo check why we need to do this on windows. */
 /* convince SDL to not overload main() */
 #define _SDL_main_h
@@ -72,5 +72,5 @@
 #endif /* VBOX_WIN32_UI */
 
-#ifdef __LINUX__
+#ifdef RT_OS_LINUX
 void PushNotifyUpdateEvent(SDL_Event *event);
 #endif
Index: trunk/src/VBox/Frontends/VBoxSDL/VBoxSDLTest.cpp
===================================================================
--- trunk/src/VBox/Frontends/VBoxSDL/VBoxSDLTest.cpp	(revision 3668)
+++ trunk/src/VBox/Frontends/VBoxSDL/VBoxSDLTest.cpp	(revision 3669)
@@ -21,5 +21,5 @@
  */
 
-#if defined(__WIN__) ///@todo someone please explain why we don't follow the book!
+#if defined(RT_OS_WINDOWS) ///@todo someone please explain why we don't follow the book!
 # define _SDL_main_h
 #endif
@@ -38,5 +38,5 @@
 #endif
 
-#ifdef __WIN__
+#ifdef RT_OS_WINDOWS
 #define ESC_NORM
 #define ESC_BOLD
@@ -92,5 +92,5 @@
     }
 
-#ifdef __WIN__
+#ifdef RT_OS_WINDOWS
     /* Default to DirectX if nothing else set. "windib" would be possible.  */
     if (!getenv("SDL_VIDEODRIVER"))
@@ -100,5 +100,5 @@
 #endif
 
-#ifdef __WIN__
+#ifdef RT_OS_WINDOWS
     _putenv("SDL_VIDEO_WINDOW_POS=0,0");
 #else
