Skip to content

Commit

Permalink
mac-reachability.c: update for C89isms
Browse files Browse the repository at this point in the history
In response to Rodrigo's comments on PR 629.
  • Loading branch information
abock committed May 2, 2013
1 parent 1ddafd7 commit d4630d0
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions support/mac-reachability.c
Expand Up @@ -28,12 +28,16 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//

int mono_sc_reachability_enabled ();
#if HAVE_CONFIG_H
#include "config.h"
#endif

int mono_sc_reachability_enabled (void);

#if defined(PLATFORM_MACOSX) || defined(TARGET_IOS)

int
mono_sc_reachability_enabled ()
mono_sc_reachability_enabled (void)
{
return 1;
}
Expand Down Expand Up @@ -80,7 +84,7 @@ mono_sc_reachability_new (mono_sc_reachability_callback callback)
{
struct sockaddr_in zero;
SCNetworkReachabilityRef reachability;
SCNetworkReachabilityContext context = {0,};
SCNetworkReachabilityContext context;
mono_sc_reachability *instance;

if (callback == NULL) {
Expand All @@ -100,6 +104,7 @@ mono_sc_reachability_new (mono_sc_reachability_callback callback)
instance->reachability = reachability;
instance->callback = callback;

bzero (&context, sizeof (context));
context.info = instance;

if (!SCNetworkReachabilitySetCallback (reachability, _mono_sc_reachability_callback, &context) ||
Expand Down Expand Up @@ -140,7 +145,7 @@ mono_sc_reachability_is_available (mono_sc_reachability *reachability)
#else

int
mono_sc_reachability_enabled ()
mono_sc_reachability_enabled (void)
{
return 0;
}
Expand Down

0 comments on commit d4630d0

Please sign in to comment.