mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-30 08:44:19 -04:00
downloader: Initialize winsock even if nativenet is compiled out
Fixes HTTPClient when static linking if nativenet is not used and therefore init_network() is compiled out
This commit is contained in:
parent
8ab37b8804
commit
38528b797b
@ -18,6 +18,9 @@
|
|||||||
#include "virtualFileMountHTTP.h"
|
#include "virtualFileMountHTTP.h"
|
||||||
#include "pandaSystem.h"
|
#include "pandaSystem.h"
|
||||||
|
|
||||||
|
#if defined(_WIN32) && defined(HAVE_OPENSSL)
|
||||||
|
#include <winsock2.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#if !defined(CPPPARSER) && !defined(LINK_ALL_STATIC) && !defined(BUILDING_PANDA_DOWNLOADER)
|
#if !defined(CPPPARSER) && !defined(LINK_ALL_STATIC) && !defined(BUILDING_PANDA_DOWNLOADER)
|
||||||
#error Buildsystem error: BUILDING_PANDA_DOWNLOADER not defined
|
#error Buildsystem error: BUILDING_PANDA_DOWNLOADER not defined
|
||||||
@ -170,5 +173,11 @@ init_libdownloader() {
|
|||||||
|
|
||||||
PandaSystem *ps = PandaSystem::get_global_ptr();
|
PandaSystem *ps = PandaSystem::get_global_ptr();
|
||||||
ps->add_system("OpenSSL");
|
ps->add_system("OpenSSL");
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
// We need to call this before we can open sockets on Windows.
|
||||||
|
static struct WSAData mydata;
|
||||||
|
WSAStartup(0x0101, &mydata);
|
||||||
|
#endif // _WIN32
|
||||||
#endif // HAVE_OPENSSL
|
#endif // HAVE_OPENSSL
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user