From: Curtis L. Olson Date: Fri, 12 Nov 2010 21:52:33 +0000 (-0600) Subject: Fix setsockopt() to match previous precident of setsockopt() usage (as seen X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=50315a734624ba9d2d1ef5cc3c34fc1263d28583;p=simgear.git Fix setsockopt() to match previous precident of setsockopt() usage (as seen later in the setBroadcast() function.) --- diff --git a/simgear/io/raw_socket.cxx b/simgear/io/raw_socket.cxx index 54b1177c..e2adb7ee 100644 --- a/simgear/io/raw_socket.cxx +++ b/simgear/io/raw_socket.cxx @@ -199,8 +199,13 @@ bool Socket::open ( bool stream ) // if ( stream ) { int opt_boolean = 1; - setsockopt( handle, SOL_SOCKET, SO_REUSEADDR, - (char *)&opt_boolean, sizeof(opt_boolean) ); +#if defined(_WIN32) || defined(__CYGWIN__) + setsockopt( handle, SOL_SOCKET, SO_REUSEADDR, (char *)&opt_boolean, + sizeof(opt_boolean) ); +#else + setsockopt( handle, SOL_SOCKET, SO_REUSEADDR, &opt_boolean, + sizeof(opt_boolean) ); +#endif } return (handle != -1);