From 50315a734624ba9d2d1ef5cc3c34fc1263d28583 Mon Sep 17 00:00:00 2001 From: "Curtis L. Olson" Date: Fri, 12 Nov 2010 15:52:33 -0600 Subject: [PATCH] Fix setsockopt() to match previous precident of setsockopt() usage (as seen later in the setBroadcast() function.) --- simgear/io/raw_socket.cxx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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); -- 2.39.5