Add support for SwiftWASM toolchain

This commit is contained in:
Liam Don 2020-08-11 10:11:25 -07:00
parent 835b3967dc
commit 87bc44a71a
2 changed files with 2 additions and 2 deletions

View File

@ -5,7 +5,7 @@
// Created by Christian Treffs on 22.07.20.
//
#if canImport(Foundation)
#if canImport(Foundation) && canImport(CoreFoundation)
import class Foundation.JSONEncoder
import class Foundation.JSONDecoder

View File

@ -7,7 +7,7 @@
#if arch(x86_64) || arch(arm64) || arch(powerpc64) || arch(powerpc64le) || arch(s390x) // 64 bit
private let kFibA: UInt = 0x9e3779b97f4a7c15 // = 11400714819323198485 aka Fibonacci Hash a value for 2^64; calculate by: 2^64 / (golden ratio)
#elseif arch(i386) || arch(arm) || os(watchOS) // 32 bit
#elseif arch(i386) || arch(arm) || os(watchOS) || arch(wasm32) // 32 bit
private let kFibA: UInt = 0x9e3779b9 // = 2654435769 aka Fibonacci Hash a value for 2^32; calculate by: 2^32 / (golden ratio)
#else
#error("unsupported architecture")