Commit Graph

23 Commits

Author SHA1 Message Date
Ozkan Sezer 39459b19cb net_udp.c (UDP_Init): lose the goto in OSX workaround, restrict the workaround to OSX builds only.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1577 af15c1b1-3010-417e-b628-4374ebc0bcbd
2018-04-20 14:35:32 +00:00
Eric Wasylishen 4bea6d51e2 UDP_Init: don't bother calling gethostbyname() if our hostname ends in ".local"
(a macOS thing), because it blocks for a few seconds and then fails
(on my system anyway), so it's pointless.

Fixes an annoying startup pause on macOS, which was reported as
https://sourceforge.net/p/quakespasm/bugs/15/

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1403 af15c1b1-3010-417e-b628-4374ebc0bcbd
2017-04-26 01:38:38 +00:00
Ozkan Sezer b9032b7815 copyright years, general tidy-up, remove unused d_ifacea.h.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1059 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-22 08:55:46 +00:00
Ozkan Sezer 58b8e509bd net_udp.c: Fixed FIONREAD ioctl to take an int* argument instead of
an unsigned long*.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@502 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-11-12 18:03:49 +00:00
Ozkan Sezer 9052c6faa8 net_udp.c: check whether the address returned by gethostbyname is an IPv4 address
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@462 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-06-27 13:10:19 +00:00
Ozkan Sezer 10e8c574bd * net_sys.h: revert previous commit undefining EWOULDBLOCK and
ECONNREFUSED for windows.  define new macros NET_EWOULDBLOCK and
  NET_ECONNREFUSED for both unix and for windows and change the
  users accordingly.
* net_udp.c, net_wins.c, net_wipx.c:
  adjust for the new NET_EWOULDBLOCK and NET_ECONNREFUSED macros.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@398 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-12 20:10:34 +00:00
Ozkan Sezer 906df3f650 const correctness changes.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@300 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-08-29 02:22:55 +00:00
Ozkan Sezer d8779f7d0d MS Visual Studio support:
* Quake/console.c, net_udp.c: replace snprintf by q_snprintf.
* Quake/common.h: Define q_snprintf as _snprintf for windows and as
snprintf for all others. Likewise for q_vsnprintf. Disable several
MSVC warnings. Define fmin and fmax as min and max macros for MSVC.
* Windows/quakespasm.vcproj, quakespasm.sln: Add Visual Studio 2005
project files.
* Windows/SDL_x64.zip: Add SDL x64 import libraries for MSVC.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@281 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-08-20 02:25:22 +00:00
Ozkan Sezer 3a6e17e627 added q_stdinc.h, adapted from uhexen2, to tidy up several includes and
macros in one place.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@277 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-08-14 20:55:39 +00:00
Ozkan Sezer 42c47095a1 net_udp.c, net_wins.c, net_wipx.c: Add more informative debug messages.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@227 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-22 18:11:00 +00:00
Ozkan Sezer 79d6d5cf5a * net_udp.c (UDP_Read): Remove the get_qsockaddr() helper which came from the
old fitzsdl port, and use the struct qsockaddr *addr argument with typecasting
as in original quake.
(get_qsockaddr): Remove.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@222 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-21 16:23:06 +00:00
Ozkan Sezer 5a4f294463 * net_udp.c (UDP_Init): Fix Con_SafePrintf() call.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@221 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-21 16:17:17 +00:00
Ozkan Sezer 01d0107869 net_udp, net_wins, net_wipx network drivers update:
- do not try to set the quake hostname to the machine name if it isn't set.
- use the newly added unix/windows socket api compatibility macros from
net_sys.h: using just an int as the socketfd wasn't a problem without win64
support: the windows SOCKET type is not only unsigned but may actually be
wider (uintptr_t, which is 8 bytes on win64).


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@220 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-21 15:24:40 +00:00
Ozkan Sezer 92481933c5 * Makefile, Makefile.darwin, Makefile.w32, Makefile.w64: Build changes:
The SDL_net driver is now disabled by default and platform-specific network
drivers will be used. To compile for SDL_net, a command like "make SDLNET=1"
must be used, in which case a new preprocessor macro _USE_SDLNET will be
defined in the CFLAGS. For windows targets when not using SDL_net, WINSOCK2
is added as another option: A command line like "make WINSOCK2=1" will enable
WinSock2 api and a new preprocessor macro _USE_WINSOCK2 will be defined in
the CFLAGS. Or, a command line like "make WINSOCK2=0" will disable WinSock2
api and the old WinSock 1.1 api will be used instead. For Win64, WinSock2 is
enabled by default. For Win32, WinSock 1.1 is the default api.
* net_bsd.c, net_dgrm.c, net_loop.c, net_main.c, net_sdl.c, net_sdlnet.c,
net_udp.c, net_win.c, net_wins.c, net_wipx.c: Use the newly added net_sys.h
header. The sys_socket_t type is not in use, yet.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@215 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-21 11:10:38 +00:00
Ozkan Sezer ca7aa6c733 * net_defs.h, net_udp.c, net_wins.c, net_wipx.c, net_sdlnet.c: prefixed
the members of qsockaddr structure with a "q".


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@207 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-21 09:20:32 +00:00
Ozkan Sezer 56d6aa3899 * net_udp.c: Changed broadcastaddr type to struct sockaddr_in.
* net_wins.c: Likewise.
* net_wipx.c: Changed broadcastaddr type to struct sockaddr_ipx.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@206 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-21 09:00:56 +00:00
Ozkan Sezer febb164f0f * net.h: separated the functions and data exported through net.h into two:
net.h now holds all public exports and the new net_defs.h holds the exports
only required by the net layer. besides the net_* files, host_cmd.c and
sv_main.c are the only reasonable foreign importers of net_defs.h: they
require accessing the qsocket_s structure members. The only one that does
not fit is menu.c needing some net exports, but it may be properly handled,
later on.
* net_defs.h: New header.
* host_cmd.c: Include net_defs.h.
* menu.c: Likewise.
* net_bsd.c: Likewise.
* net_dgrm.c: Likewise.
* net_loop.c: Likewise.
* net_main.c: Likewise.
* net_sdl.c: Likewise.
* net_sdlnet.c: Likewise.
* net_udp.c: Likewise.
* net_win.c: Likewise.
* net_wins.c: Likewise.
* net_wipx.c: Likewise.
* sv_main.c: Likewise.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@204 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-20 17:21:10 +00:00
Ozkan Sezer ccbabac1c5 * net_udp.c: Changed myAddr type to in_addr_t.
* net_wins.c: Changed myAddr type to u_long.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@199 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-20 13:10:52 +00:00
Ozkan Sezer 9940a1ef02 Some more tidy-up and minor fixing in net stuff. Largely trivial. Also
added winquake.h.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@196 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-20 10:03:05 +00:00
Ozkan Sezer 5b0a76cfd2 net_udp.h: Renamed all function argument names as socket to socketid.
net_udp.c: Renamed all function argument names as socket to socketid.
Replaced the inet_addr("127.0.0.1") call with htonl(INADDR_LOOPBACK).
Replaced qboolean _true with int _true.
net.h: Renamed the OpenSocket and CloseSocket function pointers to
Open_Socket and Close_Socket.
net_dgrm.c: Adjusted for Open_Socket and Close_Socket change.
net_sdlnet.c: Made some functions static.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@191 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-19 18:20:22 +00:00
Ozkan Sezer ce25b2ce89 * net_udp.c: more minor fixes and tidy-ups.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@190 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-19 17:04:04 +00:00
Ozkan Sezer 573e555f67 * net_udp.c: Some cleanups & tidy-ups.
* net_bsd.c: Added from original Quake source.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@187 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-19 16:37:28 +00:00
Ozkan Sezer db613ab35d initial import of SDL port of Fitzquake-0.85 / 20090510 sources.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@2 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-02-15 23:26:55 +00:00