From e9c0057a90d064513a1be79b4e37237445e12e95 Mon Sep 17 00:00:00 2001 From: Vladimir Vukicevic Date: Tue, 24 Mar 2009 20:55:17 -0700 Subject: [PATCH] WinCE bustage fix. --- dom/src/geolocation/Makefile.in | 2 +- dom/src/geolocation/nsGeolocation.cpp | 4 ++-- netwerk/base/src/nsAutodialWinCE.cpp | 11 +++++++++++ netwerk/system/wince/nsNotifyAddrListener.cpp | 13 +++++++++++++ 4 files changed, 27 insertions(+), 3 deletions(-) diff --git a/dom/src/geolocation/Makefile.in b/dom/src/geolocation/Makefile.in index 50d237b9af3..f02b9fecc41 100644 --- a/dom/src/geolocation/Makefile.in +++ b/dom/src/geolocation/Makefile.in @@ -81,7 +81,7 @@ CPPSRCS += MaemoLocationProvider.cpp LOCAL_INCLUDES += $(MOZ_LOCATION_CFLAGS) endif -ifdef WINCE +ifdef WINCE_WINDOWS_MOBILE CPPSRCS += WinMobileLocationProvider.cpp endif diff --git a/dom/src/geolocation/nsGeolocation.cpp b/dom/src/geolocation/nsGeolocation.cpp index 4bbcd9ecb6a..bc98b21a4da 100644 --- a/dom/src/geolocation/nsGeolocation.cpp +++ b/dom/src/geolocation/nsGeolocation.cpp @@ -55,7 +55,7 @@ #include "MaemoLocationProvider.h" #endif -#ifdef WINCE +#ifdef WINCE_WINDOWS_MOBILE #include "WinMobileLocationProvider.h" #endif @@ -370,7 +370,7 @@ nsGeolocationService::nsGeolocationService() #endif // if WINCE, see if we should try the WINCE location provider -#ifdef WINCE +#ifdef WINCE_WINDOWS_MOBILE if (!mProvider){ mProvider = new WinMobileLocationProvider(); } diff --git a/netwerk/base/src/nsAutodialWinCE.cpp b/netwerk/base/src/nsAutodialWinCE.cpp index e94efddc7ac..052053e7da6 100644 --- a/netwerk/base/src/nsAutodialWinCE.cpp +++ b/netwerk/base/src/nsAutodialWinCE.cpp @@ -36,7 +36,10 @@ * ***** END LICENSE BLOCK ***** */ #include + +#ifdef WINCE_WINDOWS_MOBILE #include +#endif #include "nsAutodialWinCE.h" @@ -66,6 +69,7 @@ nsRASAutodial::Init() nsresult nsRASAutodial::DialDefault(const PRUnichar* /* hostName */) { +#ifdef WINCE_WINDOWS_MOBILE HANDLE connectionHandle; // Make the connection to the new network @@ -101,10 +105,17 @@ nsresult nsRASAutodial::DialDefault(const PRUnichar* /* hostName */) return NS_ERROR_FAILURE; return NS_OK; +#else + return NS_ERROR_FAILURE; +#endif } PRBool nsRASAutodial::ShouldDialOnNetworkError() { +#ifdef WINCE_WINDOWS_MOBILE return PR_TRUE; +#else + return PR_FALSE; +#endif } diff --git a/netwerk/system/wince/nsNotifyAddrListener.cpp b/netwerk/system/wince/nsNotifyAddrListener.cpp index b116f25d091..cf25df6eb7e 100644 --- a/netwerk/system/wince/nsNotifyAddrListener.cpp +++ b/netwerk/system/wince/nsNotifyAddrListener.cpp @@ -4,7 +4,9 @@ #include "nsIObserverService.h" #include +#ifdef WINCE_WINDOWS_MOBILE #include +#endif // pulled from the header so that we do not get multiple define errors during link static const GUID nal_DestNetInternet = @@ -16,24 +18,32 @@ NS_IMPL_THREADSAFE_ISUPPORTS2(nsNotifyAddrListener, nsITimerCallback) nsNotifyAddrListener::nsNotifyAddrListener() +#ifdef wINCE_WINDOWS_MOBILE : mLinkUp(PR_FALSE) // assume false by default , mStatusKnown(PR_FALSE) +#else + : mLinkUp(PR_TRUE) // assume true by default on non-WinMo + , mStatusKnown(PR_TRUE) +#endif , mConnectionHandle(NULL) { } nsNotifyAddrListener::~nsNotifyAddrListener() { +#ifdef WINCE_WINDOWS_MOBILE if (mConnectionHandle) ConnMgrReleaseConnection(mConnectionHandle, 0); if (mTimer) mTimer->Cancel(); +#endif } nsresult nsNotifyAddrListener::Init(void) { +#ifdef WINCE_WINDOWS_MOBILE CONNMGR_CONNECTIONINFO conn_info; memset(&conn_info, 0, sizeof(conn_info)); @@ -52,6 +62,7 @@ nsNotifyAddrListener::Init(void) mTimer->InitWithCallback(this, 15*1000, // every 15 seconds nsITimer::TYPE_REPEATING_SLACK); +#endif return NS_OK; } @@ -72,6 +83,7 @@ nsNotifyAddrListener::GetLinkStatusKnown(PRBool *aIsUp) NS_IMETHODIMP nsNotifyAddrListener::Notify(nsITimer* aTimer) { +#ifdef WINCE_WINDOWS_MOBILE DWORD status; HRESULT result = ConnMgrConnectionStatus(mConnectionHandle, &status); @@ -101,5 +113,6 @@ nsNotifyAddrListener::Notify(nsITimer* aTimer) observerService->NotifyObservers(static_cast(this), NS_NETWORK_LINK_TOPIC, NS_ConvertASCIItoUTF16(event).get()); +#endif return NS_OK; }