Closed ryandesign closed 11 years ago
I think this means you're using the new Objective-C array literals syntax introduced in Apple LLVM 4.0 or official clang 3.1. Can your code be rewritten to support older compilers? From that page, the new way, which you're using, is like this:
NSArray *elements = @[ @"H", @"He", @"O", @"C" ];
Whereas the old way, which would be equivalent except compatible with older compilers, is like this:
id objects[] = { @"H", @"He", @"O", @"C" };
NSArray *elements = [NSArray arrayWithObjects:objects count:4];
(It also fails on older versions of OS X, too, but I'm guessing you guys probably don't support those anymore...)
There seems to be just this one use of array literals, so I think this patch would fix it:
--- CURLFTPSession.m.orig 2012-11-29 08:34:27.000000000 -0600
+++ CURLFTPSession.m 2013-03-11 20:07:51.000000000 -0500
@@ -350,7 +350,8 @@
{
NSString *from = [NSString stringWithFormat:@"RNFR %@", [fromPath lastPathComponent]];
NSString *to = [NSString stringWithFormat:@"RNTO %@", toPath];
- return [self executeCustomCommands:@[from, to]
+ id commands[] = {from, to};
+ return [self executeCustomCommands:[NSArray arrayWithObjects:commands count:2]
inDirectory:[fromPath stringByDeletingLastPathComponent]
createIntermediateDirectories:NO
error:error];
It compiles, at least, and is what we're now using in MacPorts:
OK, I've updated our master
branch not to use array literals.
curlhandle 3.1.1 fails to compile in MacPorts on Lion with Xcode 4.3.3 and its clang compiler, which is:
The error is:
It builds fine on OS X 10.8.2 with Xcode 4.6 and its clang, which is
Apple LLVM version 4.2 (clang-425.0.24) (based on LLVM 3.2svn)
.