Define HAVE_CFPROPERTYLISTCREATEWITHSTREAM if this is 10.6 or newer
authorLove Hornquist Astrand <lha@h5l.org>
Wed, 8 Sep 2010 19:22:12 +0000 (12:22 -0700)
committerLove Hornquist Astrand <lha@h5l.org>
Wed, 8 Sep 2010 19:22:12 +0000 (12:22 -0700)
lib/krb5/config_file.c

index 90dae5600c40964a78e4a15ab5afebe00781b6b9..22d0b90bd8d4fae0fda3944f734ed1e246083897 100644 (file)
@@ -239,7 +239,12 @@ parse_binding(struct fileptr *f, unsigned *lineno, char *p,
     return ret;
 }
 
-#ifdef __APPLE__
+#if defined(__APPLE__)
+
+#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
+#define HAVE_CFPROPERTYLISTCREATEWITHSTREAM 1
+#endif
+
 static char *
 cfstring2cstring(CFStringRef string)
 {
@@ -293,7 +298,6 @@ parse_plist_config(krb5_context context, const char *path, krb5_config_section *
 {
     CFReadStreamRef s;
     CFDictionaryRef d;
-    CFErrorRef e;
     CFURLRef url;
     
     url = CFURLCreateFromFileSystemRepresentation(kCFAllocatorDefault, (UInt8 *)path, strlen(path), FALSE);
@@ -315,7 +319,11 @@ parse_plist_config(krb5_context context, const char *path, krb5_config_section *
        return ENOENT;
     }
 
-    d = (CFDictionaryRef)CFPropertyListCreateWithStream (kCFAllocatorDefault, s, 0, kCFPropertyListImmutable, NULL, &e);
+#ifdef HAVE_CFPROPERTYLISTCREATEWITHSTREAM
+    d = (CFDictionaryRef)CFPropertyListCreateWithStream(NULL, s, 0, kCFPropertyListImmutable, NULL, NULL);
+#else 
+    d = (CFDictionaryRef)CFPropertyListCreateFromStream(NULL, s, 0, kCFPropertyListImmutable, NULL, NULL);
+#endif
     CFRelease(s);
     if (d == NULL) {
        krb5_clear_error_message(context);