mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-04-22 16:09:18 -04:00
Added Windows startup code for threads and networking.
unfortunately I can't test it! Hope it works. git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-peernet@4313 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
bb9145fc4d
commit
6cbb9417ff
@ -6,6 +6,13 @@
|
||||
#include "mainwindow.h"
|
||||
#include "dhtwindow.h"
|
||||
|
||||
/* for static PThreads under windows... we need to init the library...
|
||||
* Not sure if this is needed?
|
||||
*/
|
||||
#ifdef PTW32_STATIC_LIB
|
||||
#include <pthread.h>
|
||||
#endif
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
|
||||
@ -69,6 +76,35 @@ int main(int argc, char *argv[])
|
||||
#endif
|
||||
|
||||
|
||||
/****************** WINDOWS SPECIFIC INITIALISATION ****************/
|
||||
#if defined(_WIN32) || defined(__MINGW32__)
|
||||
|
||||
/* for static PThreads under windows... we need to init the library... */
|
||||
#ifdef PTW32_STATIC_LIB
|
||||
pthread_win32_process_attach_np();
|
||||
#endif
|
||||
|
||||
// Windows Networking Init.
|
||||
WORD wVerReq = MAKEWORD(2,2);
|
||||
WSADATA wsaData;
|
||||
|
||||
if (0 != WSAStartup(wVerReq, &wsaData))
|
||||
{
|
||||
std::cerr << "Failed to Startup Windows Networking";
|
||||
std::cerr << std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cerr << "Started Windows Networking";
|
||||
std::cerr << std::endl;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
PeerNet *pnet = new PeerNet("", configPath, portNumber);
|
||||
|
||||
if (doRestricted)
|
||||
|
Loading…
x
Reference in New Issue
Block a user