diff options
author | Jan Holesovsky <kendy@suse.cz> | 2012-12-06 10:13:38 +0100 |
---|---|---|
committer | Jan Holesovsky <kendy@suse.cz> | 2012-12-06 10:14:02 +0100 |
commit | 1ec666e2c2570e246d2603e6bf5754aaa08f4b92 (patch) | |
tree | f6a0ae036a4b765720e7a3da773c42cfba8c69e6 /sd | |
parent | 9d7c1dcbbbce69bebec54d85004a0da5074775cd (diff) |
MinGW: Fix BluetoothServer build.
Change-Id: Ie04d3c1703bcf22b746d1ee965f9ff3155a9ffeb
Diffstat (limited to 'sd')
-rw-r--r-- | sd/CppunitTest_sd_uimpress.mk | 1 | ||||
-rw-r--r-- | sd/Library_sd.mk | 1 | ||||
-rw-r--r-- | sd/source/ui/remotecontrol/BluetoothServer.cxx | 19 |
3 files changed, 14 insertions, 7 deletions
diff --git a/sd/CppunitTest_sd_uimpress.mk b/sd/CppunitTest_sd_uimpress.mk index 48d5da81ea82..9adef1d401a9 100644 --- a/sd/CppunitTest_sd_uimpress.mk +++ b/sd/CppunitTest_sd_uimpress.mk @@ -76,6 +76,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sd_uimpress,\ ifeq ($(OS),WNT) $(eval $(call gb_CppunitTest_use_system_win32_libs,sd_uimpress,\ + uuid \ ws2_32 \ )) endif diff --git a/sd/Library_sd.mk b/sd/Library_sd.mk index 449b761faa0c..730c40567354 100644 --- a/sd/Library_sd.mk +++ b/sd/Library_sd.mk @@ -113,6 +113,7 @@ $(eval $(call gb_Library_use_externals,sd,\ ifeq ($(OS),WNT) $(eval $(call gb_Library_use_system_win32_libs,sd,\ + uuid \ ws2_32 \ )) endif diff --git a/sd/source/ui/remotecontrol/BluetoothServer.cxx b/sd/source/ui/remotecontrol/BluetoothServer.cxx index 63be65e6577b..255941708f1f 100644 --- a/sd/source/ui/remotecontrol/BluetoothServer.cxx +++ b/sd/source/ui/remotecontrol/BluetoothServer.cxx @@ -32,6 +32,11 @@ #include <ws2bth.h> #endif +#ifdef __MINGW32__ +// Value taken from http://msdn.microsoft.com/en-us/library/windows/desktop/ms738518%28v=vs.85%29.aspx +#define NS_BTH 16 +#endif + // FIXME: move this into an external file and look at sharing definitions // across OS's (i.e. UUID and port ). // Also look at determining which ports are available. @@ -311,16 +316,16 @@ void SAL_CALL BluetoothServer::run() socklen_t aRemoteAddrLen = sizeof(aRemoteAddr); while ( true ) { - int bSocket; + SOCKET socket; SAL_INFO( "sdremote.bluetooth", "waiting on accept" ); - if ( (bSocket = accept(aSocket, (sockaddr*) &aRemoteAddr, &aRemoteAddrLen)) < 0 ) + if ( (socket = accept(aSocket, (sockaddr*) &aRemoteAddr, &aRemoteAddrLen)) == INVALID_SOCKET ) { - SAL_WARN( "sdremote.bluetooth", "accept failed with error" << bSocket ); + SAL_WARN( "sdremote.bluetooth", "accept failed with error " << WSAGetLastError() ); close( aSocket ); return; } else { SAL_INFO( "sdremote.bluetooth", "connection accepted" ); - Communicator* pCommunicator = new Communicator( new BufferedStreamSocket( bSocket) ); + Communicator* pCommunicator = new Communicator( new BufferedStreamSocket( socket ) ); mpCommunicators->push_back( pCommunicator ); pCommunicator->launch(); } @@ -406,14 +411,14 @@ void SAL_CALL BluetoothServer::run() int aRemoteAddrLen = sizeof(aRemoteAddr); while ( true ) { - int bSocket; - if ( (bSocket = accept(aSocket, (sockaddr*) &aRemoteAddr, &aRemoteAddrLen)) == INVALID_SOCKET ) + SOCKET socket; + if ( (socket = accept(aSocket, (sockaddr*) &aRemoteAddr, &aRemoteAddrLen)) == INVALID_SOCKET ) { closesocket( aSocket ); WSACleanup(); return; } else { - Communicator* pCommunicator = new Communicator( new BufferedStreamSocket( bSocket) ); + Communicator* pCommunicator = new Communicator( new BufferedStreamSocket( socket) ); mpCommunicators->push_back( pCommunicator ); pCommunicator->launch(); } |