]> git.mxchange.org Git - simgear.git/commitdiff
Fix setsockopt() to match previous precident of setsockopt() usage (as seen
authorCurtis L. Olson <curtolson@gmail.com>
Fri, 12 Nov 2010 21:52:33 +0000 (15:52 -0600)
committerCurtis L. Olson <curtolson@gmail.com>
Fri, 12 Nov 2010 21:52:33 +0000 (15:52 -0600)
later in the setBroadcast() function.)

simgear/io/raw_socket.cxx

index 54b1177c2a74b8dbc7668cf29df7bf61bf29759c..e2adb7eebe4a35a49b9e3d4c44699810aa7d67a1 100644 (file)
@@ -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);