diff options
Diffstat (limited to 'Tools/TestWebKitAPI/PlatformUtilities.cpp')
-rw-r--r-- | Tools/TestWebKitAPI/PlatformUtilities.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/Tools/TestWebKitAPI/PlatformUtilities.cpp b/Tools/TestWebKitAPI/PlatformUtilities.cpp index cebff7be9..c341d80be 100644 --- a/Tools/TestWebKitAPI/PlatformUtilities.cpp +++ b/Tools/TestWebKitAPI/PlatformUtilities.cpp @@ -31,6 +31,8 @@ namespace TestWebKitAPI { namespace Util { +#if WK_HAVE_C_SPI + WKContextRef createContextWithInjectedBundle() { WKRetainPtr<WKStringRef> injectedBundlePath(AdoptWK, createInjectedBundlePath()); @@ -76,14 +78,16 @@ std::string toSTD(WKRetainPtr<WKStringRef> string) return toSTD(string.get()); } -std::string toSTD(const char* string) +WKRetainPtr<WKStringRef> toWK(const char* utf8String) { - return std::string(string); + return WKRetainPtr<WKStringRef>(AdoptWK, WKStringCreateWithUTF8CString(utf8String)); } -WKRetainPtr<WKStringRef> toWK(const char* utf8String) +#endif // WK_HAVE_C_SPI + +std::string toSTD(const char* string) { - return WKRetainPtr<WKStringRef>(AdoptWK, WKStringCreateWithUTF8CString(utf8String)); + return std::string(string); } } // namespace Util |