Skip to content

Commit

Permalink
Merge pull request #4901 from kateinoigakukun/pr-7c917980cf487714a509…
Browse files Browse the repository at this point in the history
…f4f16cac55ecc3ffa855

[wasm] Port CoreFoundation/Preferences.subproj
  • Loading branch information
kateinoigakukun committed Mar 4, 2024
2 parents 7c7225a + 5dc4849 commit 131ec0d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions CoreFoundation/Preferences.subproj/CFPreferences.c
Expand Up @@ -420,7 +420,7 @@ static CFStringRef _CFPreferencesStandardDomainCacheKey(CFStringRef domainName
static CFURLRef _CFPreferencesURLForStandardDomainWithSafetyLevel(CFStringRef domainName, CFStringRef userName, CFStringRef hostName, unsigned long safeLevel) {
CFURLRef theURL = NULL;
CFAllocatorRef prefAlloc = __CFPreferencesAllocator();
#if TARGET_OS_OSX || TARGET_OS_WIN32 || TARGET_OS_LINUX || TARGET_OS_BSD
#if TARGET_OS_OSX || TARGET_OS_WIN32 || TARGET_OS_LINUX || TARGET_OS_BSD || TARGET_OS_WASI
CFURLRef prefDir = _preferencesCreateDirectoryForUserHostSafetyLevel(userName, hostName, safeLevel);
CFStringRef appName;
CFStringRef fileName;
Expand Down Expand Up @@ -454,7 +454,7 @@ static CFURLRef _CFPreferencesURLForStandardDomainWithSafetyLevel(CFStringRef do
CFRelease(appName);
}
if (fileName) {
#if TARGET_OS_MAC || TARGET_OS_LINUX || TARGET_OS_BSD
#if TARGET_OS_MAC || TARGET_OS_LINUX || TARGET_OS_BSD || TARGET_OS_WASI
theURL = CFURLCreateWithFileSystemPathRelativeToBase(prefAlloc, fileName, kCFURLPOSIXPathStyle, false, prefDir);
#elif TARGET_OS_WIN32
theURL = CFURLCreateWithFileSystemPathRelativeToBase(prefAlloc, fileName, kCFURLWindowsPathStyle, false, prefDir);
Expand Down
Expand Up @@ -55,7 +55,7 @@ static void __CFMilliSleep(uint32_t msecs) {
SleepEx(msecs, false);
#elif defined(__svr4__) || defined(__hpux__)
sleep((msecs + 900) / 1000);
#elif TARGET_OS_OSX || TARGET_OS_LINUX || TARGET_OS_BSD
#elif TARGET_OS_OSX || TARGET_OS_LINUX || TARGET_OS_BSD || TARGET_OS_WASI
struct timespec input;
input.tv_sec = msecs / 1000;
input.tv_nsec = (msecs - input.tv_sec * 1000) * 1000000;
Expand Down

0 comments on commit 131ec0d

Please sign in to comment.