]> git.saurik.com Git - apple/cf.git/commitdiff
CF-635.15.tar.gz mac-os-x-1072 v635.15
authorApple <opensource@apple.com>
Tue, 8 Nov 2011 00:32:20 +0000 (00:32 +0000)
committerApple <opensource@apple.com>
Tue, 8 Nov 2011 00:32:20 +0000 (00:32 +0000)
CFArray.c
CFBundle.c
CFInternal.h
CFPlatform.c
CFPriv.h
CFURL.c
CFVersion.c
CFWindowsUtilities.c [new file with mode: 0644]
Info.plist
MakefileLinux
MakefileVersion

index d5b070420c7fc599e970b077e6c145093d0be7f5..587dcff59b6168cbc8fb69a3b4810d9dd13eff97 100644 (file)
--- a/CFArray.c
+++ b/CFArray.c
@@ -30,7 +30,6 @@
 #include <CoreFoundation/CFPriv.h>
 #include "CFInternal.h"
 #include <string.h>
-#include <CoreFoundation/CFVersionCheck.h>
 
 const CFArrayCallBacks kCFTypeArrayCallBacks = {0, __CFTypeCollectionRetain, __CFTypeCollectionRelease, CFCopyDescription, CFEqual};
 static const CFArrayCallBacks __kCFNullArrayCallBacks = {0, NULL, NULL, NULL, NULL};
@@ -1084,10 +1083,11 @@ CFIndex CFArrayBSearchValues(CFArrayRef array, CFRange range, const void *value,
     }
     SInt32 lg = flsl(range.length) - 1;        // lg2(range.length)
     item = CFArrayGetValueAtIndex(array, range.location + -1 + (1 << lg));
-    CFIndex idx = range.location + ((CFComparisonResult)(INVOKE_CALLBACK3(comparator, item, value, context)) < 0) ? range.length - (1 << lg) : -1;
+    // idx will be the current probe index into the range
+    CFIndex idx = (comparator(item, value, context) < 0) ? range.length - (1 << lg) : -1;
     while (lg--) {
        item = CFArrayGetValueAtIndex(array, range.location + idx + (1 << lg));
-       if ((CFComparisonResult)(INVOKE_CALLBACK3(comparator, item, value, context)) < 0) {
+       if (comparator(item, value, context) < 0) {
            idx += (1 << lg);
        }
     }
index 2bfea0f6fd9b4694e293630ea19fb36921450140..a846617a383a21dc84f2d37e83cb0b71a8f60e84 100644 (file)
@@ -37,7 +37,6 @@
 #include "CFInternal.h"
 #include <CoreFoundation/CFByteOrder.h>
 #include "CFBundle_BinaryTypes.h"
-#include <CoreFoundation/CFVersionCheck.h>
 #include <ctype.h>
 #include <sys/stat.h>
 #include <stdlib.h>
@@ -4789,7 +4788,6 @@ __private_extern__ void *_CFBundleDLLGetSymbolByName(CFBundleRef bundle, CFStrin
 
 /* Workarounds to be applied in the presence of certain bundles can go here. This is called on every bundle creation.
 */
-CF_EXPORT void _CFStringSetCompatibility(CFOptionFlags);
 
 static void _CFBundleCheckWorkarounds(CFBundleRef bundle) {
 }
index c573ea810ad59d7864b828f5650c809aa003729f..e79a8544ff7d431c1b6052ea220d171ff65cc9b8 100644 (file)
@@ -302,10 +302,6 @@ extern const char *__CFgetenv(const char *n);
 #endif
 
 
-CF_EXPORT CFTypeRef _CFTryRetain(CFTypeRef cf);
-CF_EXPORT Boolean _CFIsDeallocating(CFTypeRef cf);
-
-
 CF_EXPORT void * __CFConstantStringClassReferencePtr;
 
 #ifdef __CONSTANT_CFSTRINGS__
index 97858881943147f4430061073fe1f110fbb39cc1..2024d392de04bb2d6355a3de058bfe8cd56aa908 100644 (file)
@@ -591,8 +591,6 @@ static void __CFTSDFinalize(void *arg);
 
 #if DEPLOYMENT_TARGET_WINDOWS
 
-#include "CFVersionCheck.h"
-
 static DWORD __CFTSDIndexKey = 0xFFFFFFFF;
 
 // Called from CFRuntime's startup code, on Windows only
index d1694fe22bb9ce4376e88e6bef98a9cb32ee18e4..edd6f23cf797d1243380fbb22d88a07bac16ce34 100644 (file)
--- a/CFPriv.h
+++ b/CFPriv.h
@@ -419,6 +419,9 @@ CF_INLINE bool CFCharacterSetInlineBufferIsLongCharacterMember(CFCharacterSetInl
 CF_EXPORT CFMutableStringRef _CFCreateApplicationRepositoryPath(CFAllocatorRef alloc, int nFolder);
 #endif
 
+CF_EXPORT CFTypeRef _CFTryRetain(CFTypeRef cf);
+CF_EXPORT Boolean _CFIsDeallocating(CFTypeRef cf);
+
 /*
  CFLocaleGetLanguageRegionEncodingForLocaleIdentifier gets the appropriate language and region codes,
  and the default legacy script code and encoding, for the specified locale (or language) string.
diff --git a/CFURL.c b/CFURL.c
index 786c5ba599f5cca0a713e4cdaf5857b7643310c0..9be2854b728c07bfff6e2b5858aca90270fe43b7 100644 (file)
--- a/CFURL.c
+++ b/CFURL.c
@@ -1054,8 +1054,15 @@ static CFStringRef  __CFURLCopyFormattingDescription(CFTypeRef  cf, CFDictionary
     CFURLRef  url = (CFURLRef)cf;
     __CFGenericValidateType(cf, CFURLGetTypeID());
     if (! url->_base) {
+#if DEPLOYMENT_TARGET_MACOSX
+        {
+            CFRetain(url->_string);
+            return url->_string;
+        }
+#else
         CFRetain(url->_string);
         return url->_string;
+#endif
     } else {
         // Do not dereference url->_base; it may be an ObjC object
         return CFStringCreateWithFormat(CFGetAllocator(url), NULL, CFSTR("%@ -- %@"), url->_string, url->_base);
@@ -1655,6 +1662,14 @@ static void _CFURLInit(struct __CFURL *url, CFStringRef URLString, UInt32 fsType
        if ( url->_base )
         numURLsWithBaseURL ++;
 #endif
+   {
+        if (URL_PATH_TYPE(url) != FULL_URL_REPRESENTATION) {
+            _convertToURLRepresentation((struct __CFURL *)url);
+        }
+        if (!(url->_flags & IS_PARSED)) {
+            _parseComponentsOfURL(url);
+        }
+    }
 }
 
 #if DEPLOYMENT_TARGET_MACOSX || DEPLOYMENT_TARGET_EMBEDDED || DEPLOYMENT_TARGET_LINUX
index 59cfa1cc82f6812fe66ee0dc866c05f6af6cdb1e..1fcfb29f6576b83c154c5ceabad87124a1f1c21f 100644 (file)
@@ -25,5 +25,5 @@
     Copyright 2009-2011, Apple Inc. All rights reserved.
     Responsibility: CFLite Team
 */
-const unsigned char kCFCoreFoundationVersionString[] = "@(#)PROGRAM:CoreFoundation  PROJECT:CoreFoundation-635  SYSTEM:Darwin  DEVELOPER:unknown  BUILT:" __DATE__ " " __TIME__ "\n";
-double kCFCoreFoundationVersionNumber = (double)635;
+const unsigned char kCFCoreFoundationVersionString[] = "@(#)PROGRAM:CoreFoundation  PROJECT:CoreFoundation-635.15  SYSTEM:Darwin  DEVELOPER:unknown  BUILT:" __DATE__ " " __TIME__ "\n";
+double kCFCoreFoundationVersionNumber = (double)635.15;
diff --git a/CFWindowsUtilities.c b/CFWindowsUtilities.c
new file mode 100644 (file)
index 0000000..95e545e
--- /dev/null
@@ -0,0 +1,138 @@
+/*
+ * Copyright (c) 2011 Apple Inc. All rights reserved.
+ *
+ * @APPLE_LICENSE_HEADER_START@
+ * 
+ * This file contains Original Code and/or Modifications of Original Code
+ * as defined in and that are subject to the Apple Public Source License
+ * Version 2.0 (the 'License'). You may not use this file except in
+ * compliance with the License. Please obtain a copy of the License at
+ * http://www.opensource.apple.com/apsl/ and read it before using this
+ * file.
+ * 
+ * The Original Code and all software distributed under the License are
+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
+ * Please see the License for the specific language governing rights and
+ * limitations under the License.
+ * 
+ * @APPLE_LICENSE_HEADER_END@
+ */
+
+/*     
+    CFWindowsUtilities.c
+    Copyright (c) 2008-2011, Apple Inc. All rights reserved.
+    Responsibility: Tony Parker
+*/
+
+#if DEPLOYMENT_TARGET_WINDOWS
+    
+#include <CoreFoundation/CFArray.h>
+#include <CoreFoundation/CFString.h>
+#include "CFInternal.h"
+#include "CFPriv.h"
+
+#include <shlobj.h>
+
+#include <sys/stat.h>
+
+CF_EXPORT bool OSAtomicCompareAndSwapPtr(void *oldp, void *newp, void *volatile *dst) 
+{ 
+    return oldp == InterlockedCompareExchangePointer(dst, newp, oldp);
+}
+
+CF_EXPORT bool OSAtomicCompareAndSwapLong(long oldl, long newl, long volatile *dst) 
+{ 
+    return oldl == InterlockedCompareExchange(dst, newl, oldl);
+}
+
+CF_EXPORT bool OSAtomicCompareAndSwapPtrBarrier(void *oldp, void *newp, void *volatile *dst) 
+{ 
+    return oldp == InterlockedCompareExchangePointer(dst, newp, oldp);
+}
+
+CF_EXPORT int32_t OSAtomicDecrement32Barrier(volatile int32_t *dst)
+{
+    return InterlockedDecrement((volatile long *)dst);
+}
+
+CF_EXPORT int32_t OSAtomicIncrement32Barrier(volatile int32_t *dst)
+{
+    return InterlockedIncrement((volatile long *)dst);
+}
+
+CF_EXPORT int32_t OSAtomicAdd32Barrier( int32_t theAmount, volatile int32_t *theValue ) {
+    return (InterlockedExchangeAdd((volatile LONG *)theValue, theAmount) + theAmount);
+}
+
+CF_EXPORT bool OSAtomicCompareAndSwap32Barrier(int32_t oldValue, int32_t newValue, volatile int32_t *theValue) {
+    return oldValue == InterlockedCompareExchange((long *)theValue, newValue, oldValue);
+}
+
+CF_EXPORT int32_t OSAtomicAdd32( int32_t theAmount, volatile int32_t *theValue ) {
+    return (InterlockedExchangeAdd((volatile LONG *)theValue, theAmount) + theAmount);
+}
+
+CF_EXPORT int32_t OSAtomicIncrement32(volatile int32_t *theValue) {
+    return InterlockedIncrement((volatile long *)theValue);
+}
+
+CF_EXPORT int32_t OSAtomicDecrement32(volatile int32_t *theValue) {
+    return InterlockedDecrement((volatile long *)theValue);
+}
+
+// These 64-bit versions of InterlockedCompareExchange are only available on client Vista and later, so we can't use them (yet).
+/*
+CF_EXPORT bool OSAtomicCompareAndSwap64( int64_t __oldValue, int64_t __newValue, volatile int64_t *__theValue ) {
+    return __oldValue == InterlockedCompareExchange64((volatile LONGLONG *)__theValue, __newValue, __oldValue);
+}
+
+CF_EXPORT bool OSAtomicCompareAndSwap64Barrier( int64_t __oldValue, int64_t __newValue, volatile int64_t *__theValue ) {
+    return __oldValue == InterlockedCompareExchange64((volatile LONGLONG *)__theValue, __newValue, __oldValue);
+}
+
+CF_EXPORT int64_t OSAtomicAdd64( int64_t __theAmount, volatile int64_t *__theValue ) {
+    return (InterlockedExchangeAdd64((volatile LONGLONG *)__theValue, __theAmount) + __theAmount);
+}
+
+CF_EXPORT int64_t OSAtomicAdd64Barrier( int64_t __theAmount, volatile int64_t *__theValue ) {
+    retun (InterlockedExchangeAdd64((volatile LONGLONG *)__theValue, __theAmount) + __theAmount);
+}
+ */
+
+void OSMemoryBarrier() {
+    MemoryBarrier();
+}
+
+void _CFGetFrameworkPath(wchar_t *path, int maxLength) {
+#ifdef _DEBUG
+    // might be nice to get this from the project file at some point
+    wchar_t *DLLFileName = L"CoreFoundation_debug.dll";
+#else
+    wchar_t *DLLFileName = L"CoreFoundation.dll";
+#endif
+    path[0] = path[1] = 0;
+    DWORD wResult;
+    CFIndex idx;
+    HMODULE ourModule = GetModuleHandleW(DLLFileName);
+    
+    CFAssert(ourModule, __kCFLogAssertion, "GetModuleHandle failed");
+    
+    wResult = GetModuleFileNameW(ourModule, path, maxLength);
+    CFAssert1(wResult > 0, __kCFLogAssertion, "GetModuleFileName failed: %d", GetLastError());
+    CFAssert1(wResult < maxLength, __kCFLogAssertion, "GetModuleFileName result truncated: %s", path);
+    
+    // strip off last component, the DLL name
+    for (idx = wResult - 1; idx; idx--) {
+        if ('\\' == path[idx]) {
+            path[idx] = '\0';
+            break;
+        }
+    }
+}
+
+
+#endif
+
index 93f14c18d7cbb6c3e7c350b7abb74544a03f97c6..c16df1af766b177321d8a8382e3619171c50976c 100644 (file)
@@ -15,7 +15,7 @@
        <key>CFBundlePackageType</key>
        <string>FMWK</string>
        <key>CFBundleShortVersionString</key>
-       <string>6.7</string>
+       <string>6.7.1</string>
        <key>CFBundleSignature</key>
        <string>????</string>
        <key>CFBundleVersion</key>
index 7070ab73b4dcc077b1109b084220a2489364083d..43bc87c99f760460750607fee151090f2739a080 100644 (file)
@@ -30,10 +30,7 @@ CFLAGS=-c -x c -fblocks -fpic -pipe -std=gnu99 -Wno-trigraphs -fexceptions -DCF_
 LFLAGS=-shared -fpic -init=___CFInitialize -Wl,--no-undefined,-soname,libCoreFoundation.so
 
 # Libs for open source version of ICU
-#LIBS=-lc -lpthread -lm -lrt  -licuuc -licudata -licui18n -lBlocksRuntime
-
-# Libs for Apple version of ICU
-LIBS=-lc -lpthread -lm -lrt  -licucore -lBlocksRuntime
+LIBS=-lc -lpthread -lm -lrt  -licuuc -licudata -licui18n -lBlocksRuntime
 
 .PHONY: all install clean
 .PRECIOUS: $(OBJBASE)/CoreFoundation/%.h
index 0755f30954b5547f6ac4e49e90b05409bc3dc57e..00dd41d037774644470242f18175c744a9858304 100644 (file)
@@ -1 +1 @@
-VERSION=635
+VERSION=635.15