Skip to content

Commit eded784

Browse files
Merge pull request #4910 from kateinoigakukun/pr-03a3440ba15da48de18bce17b4ed1f33afc48610
[wasm] Port CoreFoundation/Parsing.subproj
2 parents ff07568 + 5d81a9e commit eded784

File tree

3 files changed

+1
-13
lines changed

3 files changed

+1
-13
lines changed

CoreFoundation/Parsing.subproj/CFBinaryPList.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,7 @@
3131
#include "CFRuntime_Internal.h"
3232
#include "CFPropertyList_Internal.h"
3333

34-
#if !TARGET_OS_WASI
3534
#include <CoreFoundation/CFStream.h>
36-
#endif
3735

3836
enum {
3937
CF_NO_ERROR = 0,
@@ -135,7 +133,6 @@ uint32_t _CFKeyedArchiverUIDGetValue(CFKeyedArchiverUIDRef uid) {
135133

136134
CF_PRIVATE CFErrorRef __CFPropertyListCreateError(CFIndex code, CFStringRef debugString, ...);
137135

138-
#if !TARGET_OS_WASI
139136
typedef struct {
140137
CFTypeRef stream;
141138
void *databytes;
@@ -696,7 +693,6 @@ CF_PRIVATE CFDataRef __CFBinaryPlistCreateDataUsingExternalBufferAllocator(CFPro
696693
}
697694
return result;
698695
}
699-
#endif
700696

701697
#pragma mark -
702698
#pragma mark Reading

CoreFoundation/Parsing.subproj/CFPropertyList.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@
2424
#include "CFRuntime_Internal.h"
2525
#include <CoreFoundation/CFBurstTrie.h>
2626
#include <CoreFoundation/CFString.h>
27-
#if !TARGET_OS_WASI
2827
#include <CoreFoundation/CFStream.h>
29-
#endif
3028
#include <CoreFoundation/CFCalendar.h>
3129
#include "CFLocaleInternal.h"
3230
#include <limits.h>
@@ -2325,7 +2323,7 @@ static CFStringEncoding encodingForXMLData(CFDataRef data, CFErrorRef *error, CF
23252323
if (len == 5 && (*base == 'u' || *base == 'U') && (base[1] == 't' || base[1] == 'T') && (base[2] == 'f' || base[2] == 'F') && (base[3] == '-') && (base[4] == '8'))
23262324
return kCFStringEncodingUTF8;
23272325
encodingName = CFStringCreateWithBytes(kCFAllocatorSystemDefault, base, len, kCFStringEncodingISOLatin1, false);
2328-
#if TARGET_OS_MAC || TARGET_OS_WIN32 || TARGET_OS_LINUX
2326+
#if TARGET_OS_MAC || TARGET_OS_WIN32 || TARGET_OS_LINUX || TARGET_OS_WASI
23292327
CFStringEncoding enc = CFStringConvertIANACharSetNameToEncoding(encodingName);
23302328
if (enc != kCFStringEncodingInvalidId) {
23312329
if (encodingName) {CFRelease(encodingName); }
@@ -2898,7 +2896,6 @@ CFPropertyListRef CFPropertyListCreateFromXMLData(CFAllocatorRef allocator, CFDa
28982896
return result;
28992897
}
29002898

2901-
#if !TARGET_OS_WASI
29022899
CFDataRef CFPropertyListCreateData(CFAllocatorRef allocator, CFPropertyListRef propertyList, CFPropertyListFormat format, CFOptionFlags options, CFErrorRef *error) {
29032900
CFAssert1(format != kCFPropertyListOpenStepFormat, __kCFLogAssertion, "%s(): kCFPropertyListOpenStepFormat not supported for writing", __PRETTY_FUNCTION__);
29042901
CFAssert2(format == kCFPropertyListXMLFormat_v1_0 || format == kCFPropertyListBinaryFormat_v1_0, __kCFLogAssertion, "%s(): Unrecognized option %ld", __PRETTY_FUNCTION__, format);
@@ -3152,7 +3149,6 @@ bool _CFPropertyListValidateData(CFDataRef data, CFTypeID *outTopLevelTypeID) {
31523149
return result;
31533150
}
31543151

3155-
#endif
31563152

31573153
#pragma mark -
31583154
#pragma mark Property List Copies

CoreFoundation/Parsing.subproj/CFPropertyList.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@
1515
#include <CoreFoundation/CFString.h>
1616
#include <CoreFoundation/CFError.h>
1717

18-
#if !TARGET_OS_WASI
1918
#include <CoreFoundation/CFStream.h>
20-
#endif
2119

2220
CF_IMPLICIT_BRIDGING_ENABLED
2321
CF_EXTERN_C_BEGIN
@@ -131,7 +129,6 @@ CF_ENUM(CFIndex) {
131129
CF_EXPORT
132130
CFPropertyListRef CFPropertyListCreateWithData(CFAllocatorRef allocator, CFDataRef data, CFOptionFlags options, CFPropertyListFormat *format, CFErrorRef *error) API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
133131

134-
#if !TARGET_OS_WASI
135132
/* Create and return a property list with a CFReadStream input. If the format parameter is non-NULL, it will be set to the format of the data after parsing is complete. The options parameter is used to specify CFPropertyListMutabilityOptions. The streamLength parameter specifies the number of bytes to read from the stream. Set streamLength to 0 to read until the end of the stream is detected. If an error occurs while parsing the data, the return value will be NULL. Additionally, if an error occurs and the error parameter is non-NULL, the error parameter will be set to a CFError describing the problem, which the caller must release. If the parse succeeds, the returned value is a reference to the new property list. It is the responsibility of the caller to release this value.
136133
*/
137134
CF_EXPORT
@@ -141,7 +138,6 @@ CFPropertyListRef CFPropertyListCreateWithStream(CFAllocatorRef allocator, CFRea
141138
*/
142139
CF_EXPORT
143140
CFIndex CFPropertyListWrite(CFPropertyListRef propertyList, CFWriteStreamRef stream, CFPropertyListFormat format, CFOptionFlags options, CFErrorRef *error) API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
144-
#endif
145141

146142
/* Create a CFData with the bytes of a serialized property list. The format of the property list can be chosen with the format parameter. The options parameter is currently unused and should be set to 0. If an error occurs while parsing the data, the return value will be NULL. Additionally, if an error occurs and the error parameter is non-NULL, the error parameter will be set to a CFError describing the problem, which the caller must release. If the conversion succeeds, the returned value is a reference to the created data. It is the responsibility of the caller to release this value.
147143
*/

0 commit comments

Comments
 (0)