diff options
author | Aaron Bockover <abock@xamarin.com> | 2013-05-02 19:03:27 +0400 |
---|---|---|
committer | Aaron Bockover <abock@xamarin.com> | 2013-05-02 19:03:27 +0400 |
commit | d4630d000b10f56a7ac9c68ec3d54f03340951e5 (patch) | |
tree | 6a3e4339e4f8755e20603cbcbed0fb1e502eb3bb /support | |
parent | 1ddafd799738d7a9fd702c6168ed7c5694e28791 (diff) |
mac-reachability.c: update for C89isms
In response to Rodrigo's comments on PR 629.
Diffstat (limited to 'support')
-rw-r--r-- | support/mac-reachability.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/support/mac-reachability.c b/support/mac-reachability.c index 2e92b6328d7..c2499f515c0 100644 --- a/support/mac-reachability.c +++ b/support/mac-reachability.c @@ -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; } |