Fixing compilation portability
+ wscript: now code compiles with apple gcc, clang, and macport's gcc (though not working, but for unrelated reason)
+ adhoc: make it compilable with apple's gcc compiler and replace usage of the deprecated method
+ gui: adding necessary ifdef statement to not add menu item when Sparkle is not available
+ auto-update: with apple's gcc, Sparkle requires additional header include (AppKit)
Change-Id: Ie6137898c3a0ffad5f857bbd4c949c0efbbc89bc
diff --git a/adhoc/adhoc-osx.mm b/adhoc/adhoc-osx.mm
index 3b7da80..9132ad9 100644
--- a/adhoc/adhoc-osx.mm
+++ b/adhoc/adhoc-osx.mm
@@ -36,15 +36,16 @@
#import <CoreWLAN/CWInterface.h>
#import <CoreWLAN/CoreWLANTypes.h>
+const NSUInteger channel = 11;
+
bool
Adhoc::CreateAdhoc ()
{
- NSString *networkName = @"NDNdirect";
- NSNumber *channel = @11;
- NSString *passphrase = @"NDNhello";
- NSString *securityMode = @"Open";
+ NSString *networkName = [[NSString alloc] initWithCString:"NDNdirect" encoding:NSASCIIStringEncoding];
+ NSString *passphrase = [[NSString alloc] initWithCString:"NDNhello" encoding:NSASCIIStringEncoding];
+ NSString *securityMode = [[NSString alloc] initWithCString:"Open" encoding:NSASCIIStringEncoding];
- NSArray *airportInterfaces = [CWInterface supportedInterfaces];
+ NSArray *airportInterfaces = [[CWInterface interfaceNames] allObjects];
//Choose the desired interface . the first one will be enought for this example
NSString *interfaceName =[airportInterfaces objectAtIndex:0];
@@ -58,7 +59,7 @@
NSError *error = nil;
NSData* data = [networkName dataUsingEncoding:NSUTF8StringEncoding];
- BOOL created = [airport startIBSSModeWithSSID:data security:kCWIBSSModeSecurityNone channel:(NSUInteger)@11 password:passphrase error:&error];
+ BOOL created = [airport startIBSSModeWithSSID:data security:kCWIBSSModeSecurityNone channel:channel password:passphrase error:&error];
if (!created)
{
@@ -86,15 +87,10 @@
void
Adhoc::DestroyAdhoc ()
{
- NSString *networkName = @"NDNdirect";
- NSNumber *channel = @11;
- NSString *passphrase = @"NDNhello";
- NSString *securityMode = @"Open";
-
- NSArray *airportInterfaces = [CWInterface supportedInterfaces];
+ NSArray *airportInterfaces = [[CWInterface interfaceNames] allObjects];
//Choose the desired interface . the first one will be enought for this example
- NSString *interfaceName =[airportInterfaces objectAtIndex:0];
+ NSString *interfaceName = [airportInterfaces objectAtIndex:0];
CWInterface *airport = [CWInterface interfaceWithName:interfaceName];