Commit 18a305d6 authored by Jonathan Wilkes's avatar Jonathan Wilkes
Browse files

refactor so that WSAStartup call happens on Windows regardless of gui mode

parent d64241da
Pipeline #1349 passed with stage
in 341 minutes and 9 seconds
......@@ -1231,10 +1231,6 @@ int sys_startgui(const char *guidir)
if (!getcwd(cwd, FILENAME_MAX))
strcpy(cwd, ".");
#endif
#ifdef MSW
short version = MAKEWORD(2, 0);
WSADATA nobby;
#endif
#ifdef HAVE_UNISTD_H
int stdinpipe[2];
#endif
......@@ -1242,11 +1238,6 @@ int sys_startgui(const char *guidir)
sys_fdpoll = (t_fdpoll *)t_getbytes(0);
sys_nfdpoll = 0;
inbinbuf = binbuf_new();
#ifdef MSW
if (WSAStartup(version, &nobby)) sys_sockerror("WSAstartup");
#endif
if (sys_nogui)
{
/* fake the GUI's message giving cwd and font sizes; then
......
......@@ -335,9 +335,15 @@ int sys_main(int argc, char **argv)
#ifdef PD_DEBUG
fprintf(stderr, "Pd-L2Ork: COMPILED FOR DEBUGGING\n");
#endif
/* We need to call WSAStartup regardless of gui mode, since a user
* might want to make socket connections even in -nogui mode. So we
* go ahead and do that here. */
#ifdef _WIN32
short version = MAKEWORD(2, 0);
WSADATA nobby;
if (WSAStartup(version, &nobby)) sys_sockerror("WSAstartup");
/* use Win32 "binary" mode by default since we don't want the
* translation that Win32 does by default */
#ifdef _WIN32
# ifdef _MSC_VER /* MS Visual Studio */
_set_fmode( _O_BINARY );
# else /* MinGW */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment