Permalink
Browse files

mac-reachability.c: update for C89isms

In response to Rodrigo's comments on PR 629.
  • Loading branch information...
abock committed May 2, 2013
1 parent 1ddafd7 commit d4630d000b10f56a7ac9c68ec3d54f03340951e5
Showing with 9 additions and 4 deletions.
  1. +9 −4 support/mac-reachability.c
View
@@ -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;
}
@@ -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) {
@@ -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) ||
@@ -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;
}

0 comments on commit d4630d0

Please sign in to comment.