getting farther

This commit is contained in:
dave caruso
2023-10-19 18:25:13 -08:00
parent c6f29fb0ec
commit 5eabbdc27b
14 changed files with 1629 additions and 650 deletions

View File

@@ -240,7 +240,9 @@
"xutility": "cpp",
"string.h": "c",
"zutil.h": "c",
"gzguts.h": "c"
"gzguts.h": "c",
"stdatomic.h": "c",
"root_certs.h": "c"
},
"C_Cpp.errorSquiggles": "enabled",
"eslint.workingDirectories": ["packages/bun-types"],

View File

@@ -163,7 +163,6 @@ endif()
# --- Dependencies ---
if(NOT WIN32)
message(STATUS "not window")
# WebKit
if(NOT WEBKIT_DIR)
# TODO: allow this to point to the actual webkit cmake file to allow easier rebuilds
@@ -454,6 +453,12 @@ add_custom_command(
USES_TERMINAL
)
set(BUN_EXTRA_SOURCES "")
if(WIN32)
set(BUN_EXTRA_SOURCES "${BUN_SRC}/bun.js/bindings/windows/musl-memmem.c")
include_directories("${BUN_SRC}/bun.js/bindings/windows")
endif()
# -- The Buntime™ ---
add_executable(
${bun}
@@ -465,6 +470,7 @@ add_executable(
"${BUN_WORKDIR}/codegen/ZigGeneratedClasses.cpp"
"${BUN_WORKDIR}/codegen/WebCoreJSBuiltins.cpp"
"${BUN_ZIG_OBJ}"
"${BUN_EXTRA_SOURCES}"
)
set_target_properties(${bun} PROPERTIES
CXX_STANDARD 20
@@ -828,8 +834,8 @@ if(NOT MSVC)
target_link_libraries(${bun} PRIVATE "${WEBKIT_DIR}/lib/libJavaScriptCore.a")
target_link_libraries(${bun} PRIVATE "${WEBKIT_DIR}/lib/libbmalloc.a")
else()
target_link_libraries(${bun} PRIVATE "${WEBKIT_LIB_DIR}/lib/WTF.lib")
target_link_libraries(${bun} PRIVATE "${WEBKIT_LIB_DIR}/lib/JavaScriptCore.lib")
target_link_libraries(${bun} PRIVATE "${WEBKIT_LIB_DIR}/WTF.lib")
target_link_libraries(${bun} PRIVATE "${WEBKIT_LIB_DIR}/JavaScriptCore.lib")
if (WIN32)
string (APPEND CMAKE_CXX_FLAGS
@@ -849,11 +855,16 @@ else()
# include_directories(C:/Users/windo/Build/WebKit/WebKitBuild/WTF/Headers)
file(COPY C:/Users/windo/Code/WebKit/WebKitBuild/cmakeconfig.h DESTINATION ${BUN_SRC}/bun.js/bindings)
include_directories(C:/Users/windo/Code/WebKit/WebKitLibraries/win/include)
link_directories(C:/Users/windo/Code/WebKit/WebKitLibraries/win/lib64)
target_link_directories(${bun} PUBLIC ${ICU_LIBRARY})
target_include_directories(${bun} PUBLIC C:/Users/windo/Code/WebKit/WebKitLibraries/win/include)
target_link_directories(${bun} PUBLIC C:/Users/windo/Code/WebKit/WebKitLibraries/win/lib64)
target_link_directories(${bun} PUBLIC C:/Users/windo/Code/lib64)
# icudt.lib
# icuin.lib
# icuio.lib
# icutest.lib
# icutu.lib
# icuuc.lib
target_link_libraries(${bun} PUBLIC icuuc icudt icutu icuio icuin icutest)
target_link_libraries(${bun} PUBLIC winmm ws2_32 bcrypt ntdll kernel32 shell32 shlwapi advapi32 vcruntime ucrt legacy_stdio_definitions)
endif()

File diff suppressed because it is too large Load Diff

View File

@@ -204,21 +204,22 @@ struct us_socket_t *us_socket_attach(int ssl, LIBUS_SOCKET_DESCRIPTOR client_fd,
}
struct us_socket_t *us_socket_pair(struct us_socket_context_t *ctx, int socket_ext_size, LIBUS_SOCKET_DESCRIPTOR* fds) {
#ifdef LIBUS_USE_LIBUV
#if defined(LIBUS_USE_LIBUV) || defined(WIN32)
return 0;
#endif
#else
if (socketpair(AF_UNIX, SOCK_STREAM, 0, fds) != 0) {
return 0;
}
return us_socket_from_fd(ctx, socket_ext_size, fds[0]);
#endif
}
struct us_socket_t *us_socket_from_fd(struct us_socket_context_t *ctx, int socket_ext_size, LIBUS_SOCKET_DESCRIPTOR fd) {
#ifdef LIBUS_USE_LIBUV
#if defined(LIBUS_USE_LIBUV) || defined(WIN32)
return 0;
#endif
#else
struct us_poll_t *p1 = us_create_poll(ctx->loop, 0, sizeof(struct us_socket_t) + socket_ext_size);
us_poll_init(p1, fd, POLL_TYPE_SOCKET);
us_poll_start(p1, ctx->loop, LIBUS_SOCKET_READABLE | LIBUS_SOCKET_WRITABLE);
@@ -239,6 +240,7 @@ struct us_socket_t *us_socket_from_fd(struct us_socket_context_t *ctx, int socke
}
return s;
#endif
}

View File

@@ -97,6 +97,7 @@ public:
{
auto scope = DECLARE_THROW_SCOPE(lexicalGlobalObject->vm());
throwTypeError(lexicalGlobalObject, scope, "Class constructor File cannot be invoked without 'new"_s);
return {};
}
};

View File

@@ -145,7 +145,7 @@ AsymmetricKeyValueWithDER KeyObject__ParsePublicKeyPEM(const char* key_pem,
size_t key_pem_len)
{
auto bp = BIOPtr(BIO_new_mem_buf(const_cast<char*>(key_pem), key_pem_len));
auto result = (AsymmetricKeyValueWithDER) { .key = nullptr, .der_data = nullptr, .der_len = 0 };
auto result = AsymmetricKeyValueWithDER { .key = nullptr, .der_data = nullptr, .der_len = 0 };
if (!bp) {
ERR_clear_error();
@@ -2188,7 +2188,9 @@ JSC::EncodedJSValue KeyObject__generateKeySync(JSC::JSGlobalObject* lexicalGloba
throwException(lexicalGlobalObject, scope, createTypeError(lexicalGlobalObject, "Invalid length"_s));
return JSValue::encode(JSC::jsUndefined());
}
return JSC::JSValue::encode(JSCryptoKey::create(structure, zigGlobalObject, WTFMove(result.releaseNonNull())));
// TODO(@paperdave 2023-10-19): i removed WTFMove from result.releaseNonNull() as per MSVC compiler error.
// We need to evaluate if that is the proper fix here.
return JSC::JSValue::encode(JSCryptoKey::create(structure, zigGlobalObject, (result.releaseNonNull())));
} else if (type_str == "aes"_s) {
Zig::GlobalObject* zigGlobalObject = reinterpret_cast<Zig::GlobalObject*>(lexicalGlobalObject);
auto* structure = zigGlobalObject->JSCryptoKeyStructure();
@@ -2207,7 +2209,9 @@ JSC::EncodedJSValue KeyObject__generateKeySync(JSC::JSGlobalObject* lexicalGloba
throwException(lexicalGlobalObject, scope, createTypeError(lexicalGlobalObject, "Invalid length"_s));
return JSValue::encode(JSC::jsUndefined());
}
return JSC::JSValue::encode(JSCryptoKey::create(structure, zigGlobalObject, WTFMove(result.releaseNonNull())));
// TODO(@paperdave 2023-10-19): i removed WTFMove from result.releaseNonNull() as per MSVC compiler error.
// We need to evaluate if that is the proper fix here.
return JSC::JSValue::encode(JSCryptoKey::create(structure, zigGlobalObject, (result.releaseNonNull())));
} else {
throwException(lexicalGlobalObject, scope, createTypeError(lexicalGlobalObject, "algorithm should be 'aes' or 'hmac'"_s));
return JSValue::encode(JSC::jsUndefined());
@@ -2279,23 +2283,23 @@ static AsymmetricKeyValue GetInternalAsymmetricKey(WebCore::CryptoKey& key)
case CryptoAlgorithmIdentifier::RSASSA_PKCS1_v1_5:
case CryptoAlgorithmIdentifier::RSA_OAEP:
case CryptoAlgorithmIdentifier::RSA_PSS:
return (AsymmetricKeyValue) { .key = downcast<WebCore::CryptoKeyRSA>(key).platformKey(), .owned = false };
return AsymmetricKeyValue { .key = downcast<WebCore::CryptoKeyRSA>(key).platformKey(), .owned = false };
case CryptoAlgorithmIdentifier::ECDSA:
case CryptoAlgorithmIdentifier::ECDH:
return (AsymmetricKeyValue) { .key = downcast<WebCore::CryptoKeyEC>(key).platformKey(), .owned = false };
return AsymmetricKeyValue { .key = downcast<WebCore::CryptoKeyEC>(key).platformKey(), .owned = false };
case CryptoAlgorithmIdentifier::Ed25519: {
const auto& okpKey = downcast<WebCore::CryptoKeyOKP>(key);
auto keyData = okpKey.exportKey();
if (okpKey.type() == CryptoKeyType::Private) {
auto* evp_key = EVP_PKEY_new_raw_private_key(okpKey.namedCurve() == CryptoKeyOKP::NamedCurve::X25519 ? EVP_PKEY_X25519 : EVP_PKEY_ED25519, nullptr, keyData.data(), keyData.size());
return (AsymmetricKeyValue) { .key = evp_key, .owned = true };
return AsymmetricKeyValue { .key = evp_key, .owned = true };
} else {
auto* evp_key = EVP_PKEY_new_raw_public_key(okpKey.namedCurve() == CryptoKeyOKP::NamedCurve::X25519 ? EVP_PKEY_X25519 : EVP_PKEY_ED25519, nullptr, keyData.data(), keyData.size());
return (AsymmetricKeyValue) { .key = evp_key, .owned = true };
return AsymmetricKeyValue { .key = evp_key, .owned = true };
}
}
default:
return (AsymmetricKeyValue) { .key = NULL, .owned = false };
return AsymmetricKeyValue { .key = NULL, .owned = false };
}
}

View File

@@ -448,7 +448,11 @@ static String computeErrorInfoWithPrepareStackTrace(JSC::VM& vm, Zig::GlobalObje
// We need to sourcemap it if it's a GlobalObject.
if (globalObject == lexicalGlobalObject) {
size_t framesCount = stackTrace.size();
#if OS(WINDOWS) // MSVC workaround
ZigStackFrame* remappedFrames = new ZigStackFrame[framesCount];
#else
ZigStackFrame remappedFrames[framesCount];
#endif
for (int i = 0; i < framesCount; i++) {
memset(remappedFrames + i, 0, sizeof(ZigStackFrame));
remappedFrames[i].source_url = Bun::toString(lexicalGlobalObject, stackTrace.at(i).sourceURL());
@@ -476,6 +480,9 @@ static String computeErrorInfoWithPrepareStackTrace(JSC::VM& vm, Zig::GlobalObje
callSite->setLineNumber(lineNumber);
}
}
#if OS(WINDOWS) // MSVC workaround
delete remappedFrames;
#endif
}
globalObject->formatStackTrace(vm, lexicalGlobalObject, errorObject, callSites, prepareStackTrace);
@@ -3540,12 +3547,12 @@ JSC_DEFINE_CUSTOM_GETTER(getConsoleStdout, (JSGlobalObject * globalObject, Encod
auto global = jsCast<Zig::GlobalObject*>(globalObject);
// instead of calling the constructor builtin, go through the process.stdout getter to ensure it's only created once.
auto stdout = global->processObject()->get(globalObject, Identifier::fromString(vm, "stdout"_s));
if (!stdout)
auto stdoutValue = global->processObject()->get(globalObject, Identifier::fromString(vm, "stdout"_s));
if (!stdoutValue)
return JSValue::encode({});
console->putDirect(vm, property, stdout, PropertyAttribute::DontEnum | 0);
return JSValue::encode(stdout);
console->putDirect(vm, property, stdoutValue, PropertyAttribute::DontEnum | 0);
return JSValue::encode(stdoutValue);
}
// `console._stderr` is equal to `process.stderr`
@@ -3556,12 +3563,12 @@ JSC_DEFINE_CUSTOM_GETTER(getConsoleStderr, (JSGlobalObject * globalObject, Encod
auto global = jsCast<Zig::GlobalObject*>(globalObject);
// instead of calling the constructor builtin, go through the process.stdout getter to ensure it's only created once.
auto stdout = global->processObject()->get(globalObject, Identifier::fromString(vm, "stderr"_s));
if (!stdout)
auto stderrValue = global->processObject()->get(globalObject, Identifier::fromString(vm, "stderr"_s));
if (!stderrValue)
return JSValue::encode({});
console->putDirect(vm, property, stdout, PropertyAttribute::DontEnum | 0);
return JSValue::encode(stdout);
console->putDirect(vm, property, stderrValue, PropertyAttribute::DontEnum | 0);
return JSValue::encode(stderrValue);
}
JSC_DEFINE_CUSTOM_SETTER(EventSource_setter,

View File

@@ -1,8 +1,6 @@
// when we don't want to use @cInclude, we can just stick wrapper functions here
#include "root.h"
#include <sys/resource.h>
#include <cstdint>
#include "root.h"
#if !OS(WINDOWS)
#include <sys/resource.h>
@@ -10,14 +8,13 @@
#include <sys/stat.h>
#include <sys/signal.h>
#include <unistd.h>
#include <cstring>
#include <cpuid.h>
#else
#include <uv.h>
#endif // !OS(WINDOWS)
#if CPU(X86_64)
#include <cstring>
#include <cpuid.h>
#if CPU(X86_64) && !OS(WINDOWS)
extern "C" void bun_warn_avx_missing(const char* url)
{
__builtin_cpu_init();

View File

@@ -0,0 +1,887 @@
#ifndef CMAKECONFIG_H
#define CMAKECONFIG_H
#define ALLOW_LINE_AND_COLUMN_NUMBER_IN_BUILTINS 1
#define ENABLE_3D_TRANSFORMS 1
#define ENABLE_3D_TRANSFORMS 1
#define ENABLE_3D_TRANSFORMS 1
#define ENABLE_3D_TRANSFORMS 1
#define ENABLE_3D_TRANSFORMS 1
#define ENABLE_3D_TRANSFORMS 1
#define ENABLE_ACCESSIBILITY 1
#define ENABLE_ACCESSIBILITY 1
#define ENABLE_ACCESSIBILITY 1
#define ENABLE_ACCESSIBILITY 1
#define ENABLE_ACCESSIBILITY 1
#define ENABLE_ACCESSIBILITY 1
#define ENABLE_ACCESSIBILITY_ISOLATED_TREE 0
#define ENABLE_ACCESSIBILITY_ISOLATED_TREE 0
#define ENABLE_ACCESSIBILITY_ISOLATED_TREE 0
#define ENABLE_ACCESSIBILITY_ISOLATED_TREE 0
#define ENABLE_ACCESSIBILITY_ISOLATED_TREE 0
#define ENABLE_ACCESSIBILITY_ISOLATED_TREE 0
#define ENABLE_API_TESTS 0
#define ENABLE_API_TESTS 0
#define ENABLE_API_TESTS 0
#define ENABLE_API_TESTS 0
#define ENABLE_API_TESTS 0
#define ENABLE_API_TESTS 0
#define ENABLE_APPLE_PAY 0
#define ENABLE_APPLE_PAY 0
#define ENABLE_APPLE_PAY 0
#define ENABLE_APPLE_PAY 0
#define ENABLE_APPLE_PAY 0
#define ENABLE_APPLE_PAY 0
#define ENABLE_APPLICATION_MANIFEST 0
#define ENABLE_APPLICATION_MANIFEST 0
#define ENABLE_APPLICATION_MANIFEST 0
#define ENABLE_APPLICATION_MANIFEST 0
#define ENABLE_APPLICATION_MANIFEST 0
#define ENABLE_APPLICATION_MANIFEST 0
#define ENABLE_ASYNC_SCROLLING 0
#define ENABLE_ASYNC_SCROLLING 0
#define ENABLE_ASYNC_SCROLLING 0
#define ENABLE_ASYNC_SCROLLING 0
#define ENABLE_ASYNC_SCROLLING 0
#define ENABLE_ASYNC_SCROLLING 0
#define ENABLE_ATTACHMENT_ELEMENT 0
#define ENABLE_ATTACHMENT_ELEMENT 0
#define ENABLE_ATTACHMENT_ELEMENT 0
#define ENABLE_ATTACHMENT_ELEMENT 0
#define ENABLE_ATTACHMENT_ELEMENT 0
#define ENABLE_ATTACHMENT_ELEMENT 0
#define ENABLE_AUTOCAPITALIZE 0
#define ENABLE_AUTOCAPITALIZE 0
#define ENABLE_AUTOCAPITALIZE 0
#define ENABLE_AUTOCAPITALIZE 0
#define ENABLE_AUTOCAPITALIZE 0
#define ENABLE_AUTOCAPITALIZE 0
#define ENABLE_AVF_CAPTIONS 0
#define ENABLE_AVF_CAPTIONS 0
#define ENABLE_AVF_CAPTIONS 0
#define ENABLE_AVF_CAPTIONS 0
#define ENABLE_AVF_CAPTIONS 0
#define ENABLE_AVF_CAPTIONS 0
#define ENABLE_BREAKPAD 0
#define ENABLE_BREAKPAD 0
#define ENABLE_BREAKPAD 0
#define ENABLE_BREAKPAD 0
#define ENABLE_BREAKPAD 0
#define ENABLE_BREAKPAD 0
#define ENABLE_BUBBLEWRAP_SANDBOX 0
#define ENABLE_BUBBLEWRAP_SANDBOX 0
#define ENABLE_BUBBLEWRAP_SANDBOX 0
#define ENABLE_BUBBLEWRAP_SANDBOX 0
#define ENABLE_BUBBLEWRAP_SANDBOX 0
#define ENABLE_BUBBLEWRAP_SANDBOX 0
#define ENABLE_BUN_SKIP_FAILING_ASSERTIONS 0
#define ENABLE_CACHE_PARTITIONING 0
#define ENABLE_CACHE_PARTITIONING 0
#define ENABLE_CACHE_PARTITIONING 0
#define ENABLE_CACHE_PARTITIONING 0
#define ENABLE_CACHE_PARTITIONING 0
#define ENABLE_CACHE_PARTITIONING 0
#define ENABLE_CHANNEL_MESSAGING 1
#define ENABLE_CHANNEL_MESSAGING 1
#define ENABLE_CHANNEL_MESSAGING 1
#define ENABLE_CHANNEL_MESSAGING 1
#define ENABLE_CHANNEL_MESSAGING 1
#define ENABLE_CHANNEL_MESSAGING 1
#define ENABLE_COG 0
#define ENABLE_COG 0
#define ENABLE_COG 0
#define ENABLE_COG 0
#define ENABLE_COG 0
#define ENABLE_COG 0
#define ENABLE_CONTENT_EXTENSIONS 0
#define ENABLE_CONTENT_EXTENSIONS 0
#define ENABLE_CONTENT_EXTENSIONS 0
#define ENABLE_CONTENT_EXTENSIONS 0
#define ENABLE_CONTENT_EXTENSIONS 0
#define ENABLE_CONTENT_EXTENSIONS 0
#define ENABLE_CONTENT_FILTERING 0
#define ENABLE_CONTENT_FILTERING 0
#define ENABLE_CONTENT_FILTERING 0
#define ENABLE_CONTENT_FILTERING 0
#define ENABLE_CONTENT_FILTERING 0
#define ENABLE_CONTENT_FILTERING 0
#define ENABLE_CONTEXT_MENUS 1
#define ENABLE_CONTEXT_MENUS 1
#define ENABLE_CONTEXT_MENUS 1
#define ENABLE_CONTEXT_MENUS 1
#define ENABLE_CONTEXT_MENUS 1
#define ENABLE_CONTEXT_MENUS 1
#define ENABLE_CORE_IMAGE_ACCELERATED_FILTER_RENDER 0
#define ENABLE_CORE_IMAGE_ACCELERATED_FILTER_RENDER 0
#define ENABLE_CORE_IMAGE_ACCELERATED_FILTER_RENDER 0
#define ENABLE_CORE_IMAGE_ACCELERATED_FILTER_RENDER 0
#define ENABLE_CORE_IMAGE_ACCELERATED_FILTER_RENDER 0
#define ENABLE_CORE_IMAGE_ACCELERATED_FILTER_RENDER 0
#define ENABLE_CSS_BOX_DECORATION_BREAK 1
#define ENABLE_CSS_BOX_DECORATION_BREAK 1
#define ENABLE_CSS_BOX_DECORATION_BREAK 1
#define ENABLE_CSS_BOX_DECORATION_BREAK 1
#define ENABLE_CSS_BOX_DECORATION_BREAK 1
#define ENABLE_CSS_BOX_DECORATION_BREAK 1
#define ENABLE_CSS_COMPOSITING 1
#define ENABLE_CSS_COMPOSITING 1
#define ENABLE_CSS_COMPOSITING 1
#define ENABLE_CSS_COMPOSITING 1
#define ENABLE_CSS_COMPOSITING 1
#define ENABLE_CSS_COMPOSITING 1
#define ENABLE_CSS_CONIC_GRADIENTS 0
#define ENABLE_CSS_CONIC_GRADIENTS 0
#define ENABLE_CSS_CONIC_GRADIENTS 0
#define ENABLE_CSS_CONIC_GRADIENTS 0
#define ENABLE_CSS_CONIC_GRADIENTS 0
#define ENABLE_CSS_CONIC_GRADIENTS 0
#define ENABLE_CSS_PAINTING_API 0
#define ENABLE_CSS_PAINTING_API 0
#define ENABLE_CSS_PAINTING_API 0
#define ENABLE_CSS_PAINTING_API 0
#define ENABLE_CSS_PAINTING_API 0
#define ENABLE_CSS_PAINTING_API 0
#define ENABLE_CURSOR_VISIBILITY 0
#define ENABLE_CURSOR_VISIBILITY 0
#define ENABLE_CURSOR_VISIBILITY 0
#define ENABLE_CURSOR_VISIBILITY 0
#define ENABLE_CURSOR_VISIBILITY 0
#define ENABLE_CURSOR_VISIBILITY 0
#define ENABLE_C_LOOP 0
#define ENABLE_C_LOOP 0
#define ENABLE_C_LOOP 0
#define ENABLE_C_LOOP 0
#define ENABLE_C_LOOP 0
#define ENABLE_C_LOOP 0
#define ENABLE_DARK_MODE_CSS 0
#define ENABLE_DARK_MODE_CSS 0
#define ENABLE_DARK_MODE_CSS 0
#define ENABLE_DARK_MODE_CSS 0
#define ENABLE_DARK_MODE_CSS 0
#define ENABLE_DARK_MODE_CSS 0
#define ENABLE_DATACUE_VALUE 0
#define ENABLE_DATACUE_VALUE 0
#define ENABLE_DATACUE_VALUE 0
#define ENABLE_DATACUE_VALUE 0
#define ENABLE_DATACUE_VALUE 0
#define ENABLE_DATACUE_VALUE 0
#define ENABLE_DATALIST_ELEMENT 0
#define ENABLE_DATALIST_ELEMENT 0
#define ENABLE_DATALIST_ELEMENT 0
#define ENABLE_DATALIST_ELEMENT 0
#define ENABLE_DATALIST_ELEMENT 0
#define ENABLE_DATALIST_ELEMENT 0
#define ENABLE_DEVICE_ORIENTATION 0
#define ENABLE_DEVICE_ORIENTATION 0
#define ENABLE_DEVICE_ORIENTATION 0
#define ENABLE_DEVICE_ORIENTATION 0
#define ENABLE_DEVICE_ORIENTATION 0
#define ENABLE_DEVICE_ORIENTATION 0
#define ENABLE_DFG_JIT 1
#define ENABLE_DFG_JIT 1
#define ENABLE_DFG_JIT 1
#define ENABLE_DFG_JIT 1
#define ENABLE_DFG_JIT 1
#define ENABLE_DFG_JIT 1
#define ENABLE_DOWNLOAD_ATTRIBUTE 0
#define ENABLE_DOWNLOAD_ATTRIBUTE 0
#define ENABLE_DOWNLOAD_ATTRIBUTE 0
#define ENABLE_DOWNLOAD_ATTRIBUTE 0
#define ENABLE_DOWNLOAD_ATTRIBUTE 0
#define ENABLE_DOWNLOAD_ATTRIBUTE 0
#define ENABLE_DRAG_SUPPORT 0
#define ENABLE_DRAG_SUPPORT 0
#define ENABLE_DRAG_SUPPORT 0
#define ENABLE_DRAG_SUPPORT 0
#define ENABLE_DRAG_SUPPORT 0
#define ENABLE_DRAG_SUPPORT 0
#define ENABLE_ENCRYPTED_MEDIA 0
#define ENABLE_ENCRYPTED_MEDIA 0
#define ENABLE_ENCRYPTED_MEDIA 0
#define ENABLE_ENCRYPTED_MEDIA 0
#define ENABLE_ENCRYPTED_MEDIA 0
#define ENABLE_ENCRYPTED_MEDIA 0
#define ENABLE_EXPERIMENTAL_FEATURES 0
#define ENABLE_EXPERIMENTAL_FEATURES 0
#define ENABLE_EXPERIMENTAL_FEATURES 0
#define ENABLE_EXPERIMENTAL_FEATURES 0
#define ENABLE_EXPERIMENTAL_FEATURES 0
#define ENABLE_EXPERIMENTAL_FEATURES 0
#define ENABLE_EXPERIMENTAL_FEATURES 0
#define ENABLE_FILTERS_LEVEL_2 0
#define ENABLE_FILTERS_LEVEL_2 0
#define ENABLE_FILTERS_LEVEL_2 0
#define ENABLE_FILTERS_LEVEL_2 0
#define ENABLE_FILTERS_LEVEL_2 0
#define ENABLE_FILTERS_LEVEL_2 0
#define ENABLE_FTL_JIT 0
#define ENABLE_FTL_JIT 0
#define ENABLE_FTL_JIT 0
#define ENABLE_FTL_JIT 0
#define ENABLE_FTL_JIT 0
#define ENABLE_FTL_JIT 0
#define ENABLE_FTPDIR 1
#define ENABLE_FTPDIR 1
#define ENABLE_FTPDIR 1
#define ENABLE_FTPDIR 1
#define ENABLE_FTPDIR 1
#define ENABLE_FTPDIR 1
#define ENABLE_FULLSCREEN_API 1
#define ENABLE_FULLSCREEN_API 1
#define ENABLE_FULLSCREEN_API 1
#define ENABLE_FULLSCREEN_API 1
#define ENABLE_FULLSCREEN_API 1
#define ENABLE_FULLSCREEN_API 1
#define ENABLE_GAMEPAD 0
#define ENABLE_GAMEPAD 0
#define ENABLE_GAMEPAD 0
#define ENABLE_GAMEPAD 0
#define ENABLE_GAMEPAD 0
#define ENABLE_GAMEPAD 0
#define ENABLE_GEOLOCATION 1
#define ENABLE_GEOLOCATION 1
#define ENABLE_GEOLOCATION 1
#define ENABLE_GEOLOCATION 1
#define ENABLE_GEOLOCATION 1
#define ENABLE_GEOLOCATION 1
#define ENABLE_GPU_PROCESS 0
#define ENABLE_GPU_PROCESS 0
#define ENABLE_GPU_PROCESS 0
#define ENABLE_GPU_PROCESS 0
#define ENABLE_GPU_PROCESS 0
#define ENABLE_GPU_PROCESS 0
#define ENABLE_IMAGE_DIFF 1
#define ENABLE_IMAGE_DIFF 1
#define ENABLE_IMAGE_DIFF 1
#define ENABLE_IMAGE_DIFF 1
#define ENABLE_IMAGE_DIFF 1
#define ENABLE_IMAGE_DIFF 1
#define ENABLE_INPUT_TYPE_COLOR 0
#define ENABLE_INPUT_TYPE_COLOR 0
#define ENABLE_INPUT_TYPE_COLOR 0
#define ENABLE_INPUT_TYPE_COLOR 0
#define ENABLE_INPUT_TYPE_COLOR 0
#define ENABLE_INPUT_TYPE_COLOR 0
#define ENABLE_INPUT_TYPE_DATE 0
#define ENABLE_INPUT_TYPE_DATE 0
#define ENABLE_INPUT_TYPE_DATE 0
#define ENABLE_INPUT_TYPE_DATE 0
#define ENABLE_INPUT_TYPE_DATE 0
#define ENABLE_INPUT_TYPE_DATE 0
#define ENABLE_INPUT_TYPE_DATETIMELOCAL 0
#define ENABLE_INPUT_TYPE_DATETIMELOCAL 0
#define ENABLE_INPUT_TYPE_DATETIMELOCAL 0
#define ENABLE_INPUT_TYPE_DATETIMELOCAL 0
#define ENABLE_INPUT_TYPE_DATETIMELOCAL 0
#define ENABLE_INPUT_TYPE_DATETIMELOCAL 0
#define ENABLE_INPUT_TYPE_MONTH 0
#define ENABLE_INPUT_TYPE_MONTH 0
#define ENABLE_INPUT_TYPE_MONTH 0
#define ENABLE_INPUT_TYPE_MONTH 0
#define ENABLE_INPUT_TYPE_MONTH 0
#define ENABLE_INPUT_TYPE_MONTH 0
#define ENABLE_INPUT_TYPE_TIME 0
#define ENABLE_INPUT_TYPE_TIME 0
#define ENABLE_INPUT_TYPE_TIME 0
#define ENABLE_INPUT_TYPE_TIME 0
#define ENABLE_INPUT_TYPE_TIME 0
#define ENABLE_INPUT_TYPE_TIME 0
#define ENABLE_INPUT_TYPE_WEEK 0
#define ENABLE_INPUT_TYPE_WEEK 0
#define ENABLE_INPUT_TYPE_WEEK 0
#define ENABLE_INPUT_TYPE_WEEK 0
#define ENABLE_INPUT_TYPE_WEEK 0
#define ENABLE_INPUT_TYPE_WEEK 0
#define ENABLE_INSPECTOR_ALTERNATE_DISPATCHERS 1
#define ENABLE_INSPECTOR_ALTERNATE_DISPATCHERS 1
#define ENABLE_INSPECTOR_ALTERNATE_DISPATCHERS 1
#define ENABLE_INSPECTOR_ALTERNATE_DISPATCHERS 1
#define ENABLE_INSPECTOR_ALTERNATE_DISPATCHERS 1
#define ENABLE_INSPECTOR_ALTERNATE_DISPATCHERS 1
#define ENABLE_INSPECTOR_EXTENSIONS 0
#define ENABLE_INSPECTOR_EXTENSIONS 0
#define ENABLE_INSPECTOR_EXTENSIONS 0
#define ENABLE_INSPECTOR_EXTENSIONS 0
#define ENABLE_INSPECTOR_EXTENSIONS 0
#define ENABLE_INSPECTOR_EXTENSIONS 0
#define ENABLE_INSPECTOR_TELEMETRY 0
#define ENABLE_INSPECTOR_TELEMETRY 0
#define ENABLE_INSPECTOR_TELEMETRY 0
#define ENABLE_INSPECTOR_TELEMETRY 0
#define ENABLE_INSPECTOR_TELEMETRY 0
#define ENABLE_INSPECTOR_TELEMETRY 0
#define ENABLE_IOS_GESTURE_EVENTS 0
#define ENABLE_IOS_GESTURE_EVENTS 0
#define ENABLE_IOS_GESTURE_EVENTS 0
#define ENABLE_IOS_GESTURE_EVENTS 0
#define ENABLE_IOS_GESTURE_EVENTS 0
#define ENABLE_IOS_GESTURE_EVENTS 0
#define ENABLE_IOS_TOUCH_EVENTS 0
#define ENABLE_IOS_TOUCH_EVENTS 0
#define ENABLE_IOS_TOUCH_EVENTS 0
#define ENABLE_IOS_TOUCH_EVENTS 0
#define ENABLE_IOS_TOUCH_EVENTS 0
#define ENABLE_IOS_TOUCH_EVENTS 0
#define ENABLE_JIT 1
#define ENABLE_JIT 1
#define ENABLE_JIT 1
#define ENABLE_JIT 1
#define ENABLE_JIT 1
#define ENABLE_JIT 1
#define ENABLE_LAYER_BASED_SVG_ENGINE 0
#define ENABLE_LAYER_BASED_SVG_ENGINE 0
#define ENABLE_LAYER_BASED_SVG_ENGINE 0
#define ENABLE_LAYER_BASED_SVG_ENGINE 0
#define ENABLE_LAYER_BASED_SVG_ENGINE 0
#define ENABLE_LAYER_BASED_SVG_ENGINE 0
#define ENABLE_LAYOUT_TESTS 0
#define ENABLE_LAYOUT_TESTS 0
#define ENABLE_LAYOUT_TESTS 0
#define ENABLE_LAYOUT_TESTS 0
#define ENABLE_LAYOUT_TESTS 0
#define ENABLE_LAYOUT_TESTS 0
#define ENABLE_LEGACY_CUSTOM_PROTOCOL_MANAGER 0
#define ENABLE_LEGACY_CUSTOM_PROTOCOL_MANAGER 0
#define ENABLE_LEGACY_CUSTOM_PROTOCOL_MANAGER 0
#define ENABLE_LEGACY_CUSTOM_PROTOCOL_MANAGER 0
#define ENABLE_LEGACY_CUSTOM_PROTOCOL_MANAGER 0
#define ENABLE_LEGACY_CUSTOM_PROTOCOL_MANAGER 0
#define ENABLE_LEGACY_ENCRYPTED_MEDIA 0
#define ENABLE_LEGACY_ENCRYPTED_MEDIA 0
#define ENABLE_LEGACY_ENCRYPTED_MEDIA 0
#define ENABLE_LEGACY_ENCRYPTED_MEDIA 0
#define ENABLE_LEGACY_ENCRYPTED_MEDIA 0
#define ENABLE_LEGACY_ENCRYPTED_MEDIA 0
#define ENABLE_LETTERPRESS 0
#define ENABLE_LETTERPRESS 0
#define ENABLE_LETTERPRESS 0
#define ENABLE_LETTERPRESS 0
#define ENABLE_LETTERPRESS 0
#define ENABLE_LETTERPRESS 0
#define ENABLE_LLVM_PROFILE_GENERATION 0
#define ENABLE_LLVM_PROFILE_GENERATION 0
#define ENABLE_LLVM_PROFILE_GENERATION 0
#define ENABLE_LLVM_PROFILE_GENERATION 0
#define ENABLE_LLVM_PROFILE_GENERATION 0
#define ENABLE_LLVM_PROFILE_GENERATION 0
#define ENABLE_MANAGED_MEDIA_SOURCE 0
#define ENABLE_MANAGED_MEDIA_SOURCE 0
#define ENABLE_MANAGED_MEDIA_SOURCE 0
#define ENABLE_MANAGED_MEDIA_SOURCE 0
#define ENABLE_MANAGED_MEDIA_SOURCE 0
#define ENABLE_MANAGED_MEDIA_SOURCE 0
#define ENABLE_MATHML 1
#define ENABLE_MATHML 1
#define ENABLE_MATHML 1
#define ENABLE_MATHML 1
#define ENABLE_MATHML 1
#define ENABLE_MATHML 1
#define ENABLE_MEDIA_CAPTURE 0
#define ENABLE_MEDIA_CAPTURE 0
#define ENABLE_MEDIA_CAPTURE 0
#define ENABLE_MEDIA_CAPTURE 0
#define ENABLE_MEDIA_CAPTURE 0
#define ENABLE_MEDIA_CAPTURE 0
#define ENABLE_MEDIA_CONTROLS_CONTEXT_MENUS 0
#define ENABLE_MEDIA_CONTROLS_CONTEXT_MENUS 0
#define ENABLE_MEDIA_CONTROLS_CONTEXT_MENUS 0
#define ENABLE_MEDIA_CONTROLS_CONTEXT_MENUS 0
#define ENABLE_MEDIA_CONTROLS_CONTEXT_MENUS 0
#define ENABLE_MEDIA_CONTROLS_CONTEXT_MENUS 0
#define ENABLE_MEDIA_CONTROLS_SCRIPT 1
#define ENABLE_MEDIA_CONTROLS_SCRIPT 1
#define ENABLE_MEDIA_CONTROLS_SCRIPT 1
#define ENABLE_MEDIA_CONTROLS_SCRIPT 1
#define ENABLE_MEDIA_CONTROLS_SCRIPT 1
#define ENABLE_MEDIA_CONTROLS_SCRIPT 1
#define ENABLE_MEDIA_RECORDER 0
#define ENABLE_MEDIA_RECORDER 0
#define ENABLE_MEDIA_RECORDER 0
#define ENABLE_MEDIA_RECORDER 0
#define ENABLE_MEDIA_RECORDER 0
#define ENABLE_MEDIA_RECORDER 0
#define ENABLE_MEDIA_SESSION 0
#define ENABLE_MEDIA_SESSION 0
#define ENABLE_MEDIA_SESSION 0
#define ENABLE_MEDIA_SESSION 0
#define ENABLE_MEDIA_SESSION 0
#define ENABLE_MEDIA_SESSION 0
#define ENABLE_MEDIA_SESSION_COORDINATOR 0
#define ENABLE_MEDIA_SESSION_COORDINATOR 0
#define ENABLE_MEDIA_SESSION_COORDINATOR 0
#define ENABLE_MEDIA_SESSION_COORDINATOR 0
#define ENABLE_MEDIA_SESSION_COORDINATOR 0
#define ENABLE_MEDIA_SESSION_COORDINATOR 0
#define ENABLE_MEDIA_SESSION_PLAYLIST 0
#define ENABLE_MEDIA_SESSION_PLAYLIST 0
#define ENABLE_MEDIA_SESSION_PLAYLIST 0
#define ENABLE_MEDIA_SESSION_PLAYLIST 0
#define ENABLE_MEDIA_SESSION_PLAYLIST 0
#define ENABLE_MEDIA_SESSION_PLAYLIST 0
#define ENABLE_MEDIA_SOURCE 0
#define ENABLE_MEDIA_SOURCE 0
#define ENABLE_MEDIA_SOURCE 0
#define ENABLE_MEDIA_SOURCE 0
#define ENABLE_MEDIA_SOURCE 0
#define ENABLE_MEDIA_SOURCE 0
#define ENABLE_MEDIA_STATISTICS 0
#define ENABLE_MEDIA_STATISTICS 0
#define ENABLE_MEDIA_STATISTICS 0
#define ENABLE_MEDIA_STATISTICS 0
#define ENABLE_MEDIA_STATISTICS 0
#define ENABLE_MEDIA_STATISTICS 0
#define ENABLE_MEDIA_STREAM 0
#define ENABLE_MEDIA_STREAM 0
#define ENABLE_MEDIA_STREAM 0
#define ENABLE_MEDIA_STREAM 0
#define ENABLE_MEDIA_STREAM 0
#define ENABLE_MEDIA_STREAM 0
#define ENABLE_MEMORY_SAMPLER 0
#define ENABLE_MEMORY_SAMPLER 0
#define ENABLE_MEMORY_SAMPLER 0
#define ENABLE_MEMORY_SAMPLER 0
#define ENABLE_MEMORY_SAMPLER 0
#define ENABLE_MEMORY_SAMPLER 0
#define ENABLE_MHTML 0
#define ENABLE_MHTML 0
#define ENABLE_MHTML 0
#define ENABLE_MHTML 0
#define ENABLE_MHTML 0
#define ENABLE_MHTML 0
#define ENABLE_MINIBROWSER 0
#define ENABLE_MINIBROWSER 0
#define ENABLE_MINIBROWSER 0
#define ENABLE_MINIBROWSER 0
#define ENABLE_MINIBROWSER 0
#define ENABLE_MINIBROWSER 0
#define ENABLE_MODERN_MEDIA_CONTROLS 0
#define ENABLE_MODERN_MEDIA_CONTROLS 0
#define ENABLE_MODERN_MEDIA_CONTROLS 0
#define ENABLE_MODERN_MEDIA_CONTROLS 0
#define ENABLE_MODERN_MEDIA_CONTROLS 0
#define ENABLE_MODERN_MEDIA_CONTROLS 0
#define ENABLE_MOUSE_CURSOR_SCALE 0
#define ENABLE_MOUSE_CURSOR_SCALE 0
#define ENABLE_MOUSE_CURSOR_SCALE 0
#define ENABLE_MOUSE_CURSOR_SCALE 0
#define ENABLE_MOUSE_CURSOR_SCALE 0
#define ENABLE_MOUSE_CURSOR_SCALE 0
#define ENABLE_NAVIGATOR_STANDALONE 0
#define ENABLE_NAVIGATOR_STANDALONE 0
#define ENABLE_NAVIGATOR_STANDALONE 0
#define ENABLE_NAVIGATOR_STANDALONE 0
#define ENABLE_NAVIGATOR_STANDALONE 0
#define ENABLE_NAVIGATOR_STANDALONE 0
#define ENABLE_NETSCAPE_PLUGIN_API 1
#define ENABLE_NETSCAPE_PLUGIN_API 1
#define ENABLE_NETSCAPE_PLUGIN_API 1
#define ENABLE_NETSCAPE_PLUGIN_API 1
#define ENABLE_NETSCAPE_PLUGIN_API 1
#define ENABLE_NETSCAPE_PLUGIN_API 1
#define ENABLE_NETWORK_CACHE_SPECULATIVE_REVALIDATION 0
#define ENABLE_NETWORK_CACHE_SPECULATIVE_REVALIDATION 0
#define ENABLE_NETWORK_CACHE_SPECULATIVE_REVALIDATION 0
#define ENABLE_NETWORK_CACHE_SPECULATIVE_REVALIDATION 0
#define ENABLE_NETWORK_CACHE_SPECULATIVE_REVALIDATION 0
#define ENABLE_NETWORK_CACHE_SPECULATIVE_REVALIDATION 0
#define ENABLE_NETWORK_CACHE_STALE_WHILE_REVALIDATE 0
#define ENABLE_NETWORK_CACHE_STALE_WHILE_REVALIDATE 0
#define ENABLE_NETWORK_CACHE_STALE_WHILE_REVALIDATE 0
#define ENABLE_NETWORK_CACHE_STALE_WHILE_REVALIDATE 0
#define ENABLE_NETWORK_CACHE_STALE_WHILE_REVALIDATE 0
#define ENABLE_NETWORK_CACHE_STALE_WHILE_REVALIDATE 0
#define ENABLE_NOTIFICATIONS 1
#define ENABLE_NOTIFICATIONS 1
#define ENABLE_NOTIFICATIONS 1
#define ENABLE_NOTIFICATIONS 1
#define ENABLE_NOTIFICATIONS 1
#define ENABLE_NOTIFICATIONS 1
#define ENABLE_OFFSCREEN_CANVAS 0
#define ENABLE_OFFSCREEN_CANVAS 0
#define ENABLE_OFFSCREEN_CANVAS 0
#define ENABLE_OFFSCREEN_CANVAS 0
#define ENABLE_OFFSCREEN_CANVAS 0
#define ENABLE_OFFSCREEN_CANVAS 0
#define ENABLE_OFFSCREEN_CANVAS_IN_WORKERS 0
#define ENABLE_OFFSCREEN_CANVAS_IN_WORKERS 0
#define ENABLE_OFFSCREEN_CANVAS_IN_WORKERS 0
#define ENABLE_OFFSCREEN_CANVAS_IN_WORKERS 0
#define ENABLE_OFFSCREEN_CANVAS_IN_WORKERS 0
#define ENABLE_OFFSCREEN_CANVAS_IN_WORKERS 0
#define ENABLE_ORIENTATION_EVENTS 0
#define ENABLE_ORIENTATION_EVENTS 0
#define ENABLE_ORIENTATION_EVENTS 0
#define ENABLE_ORIENTATION_EVENTS 0
#define ENABLE_ORIENTATION_EVENTS 0
#define ENABLE_ORIENTATION_EVENTS 0
#define ENABLE_OVERFLOW_SCROLLING_TOUCH 0
#define ENABLE_OVERFLOW_SCROLLING_TOUCH 0
#define ENABLE_OVERFLOW_SCROLLING_TOUCH 0
#define ENABLE_OVERFLOW_SCROLLING_TOUCH 0
#define ENABLE_OVERFLOW_SCROLLING_TOUCH 0
#define ENABLE_OVERFLOW_SCROLLING_TOUCH 0
#define ENABLE_PAYMENT_REQUEST 0
#define ENABLE_PAYMENT_REQUEST 0
#define ENABLE_PAYMENT_REQUEST 0
#define ENABLE_PAYMENT_REQUEST 0
#define ENABLE_PAYMENT_REQUEST 0
#define ENABLE_PAYMENT_REQUEST 0
#define ENABLE_PDFJS 0
#define ENABLE_PDFJS 0
#define ENABLE_PDFJS 0
#define ENABLE_PDFJS 0
#define ENABLE_PDFJS 0
#define ENABLE_PDFJS 0
#define ENABLE_PDFKIT_PLUGIN 0
#define ENABLE_PDFKIT_PLUGIN 0
#define ENABLE_PDFKIT_PLUGIN 0
#define ENABLE_PDFKIT_PLUGIN 0
#define ENABLE_PDFKIT_PLUGIN 0
#define ENABLE_PDFKIT_PLUGIN 0
#define ENABLE_PERIODIC_MEMORY_MONITOR 0
#define ENABLE_PERIODIC_MEMORY_MONITOR 0
#define ENABLE_PERIODIC_MEMORY_MONITOR 0
#define ENABLE_PERIODIC_MEMORY_MONITOR 0
#define ENABLE_PERIODIC_MEMORY_MONITOR 0
#define ENABLE_PERIODIC_MEMORY_MONITOR 0
#define ENABLE_PICTURE_IN_PICTURE_API 0
#define ENABLE_PICTURE_IN_PICTURE_API 0
#define ENABLE_PICTURE_IN_PICTURE_API 0
#define ENABLE_PICTURE_IN_PICTURE_API 0
#define ENABLE_PICTURE_IN_PICTURE_API 0
#define ENABLE_PICTURE_IN_PICTURE_API 0
#define ENABLE_POINTER_LOCK 0
#define ENABLE_POINTER_LOCK 0
#define ENABLE_POINTER_LOCK 0
#define ENABLE_POINTER_LOCK 0
#define ENABLE_POINTER_LOCK 0
#define ENABLE_POINTER_LOCK 0
#define ENABLE_PUBLIC_SUFFIX_LIST 1
#define ENABLE_PUBLIC_SUFFIX_LIST 1
#define ENABLE_PUBLIC_SUFFIX_LIST 1
#define ENABLE_PUBLIC_SUFFIX_LIST 1
#define ENABLE_PUBLIC_SUFFIX_LIST 1
#define ENABLE_PUBLIC_SUFFIX_LIST 1
#define ENABLE_RELEASE_LOG 0
#define ENABLE_RELEASE_LOG 0
#define ENABLE_RELEASE_LOG 0
#define ENABLE_RELEASE_LOG 0
#define ENABLE_RELEASE_LOG 0
#define ENABLE_RELEASE_LOG 0
#define ENABLE_REMOTE_INSPECTOR 1
#define ENABLE_REMOTE_INSPECTOR 1
#define ENABLE_REMOTE_INSPECTOR 1
#define ENABLE_REMOTE_INSPECTOR 1
#define ENABLE_REMOTE_INSPECTOR 1
#define ENABLE_REMOTE_INSPECTOR 1
#define ENABLE_REMOTE_INSPECTOR 1
#define ENABLE_RESOURCE_USAGE 1
#define ENABLE_RESOURCE_USAGE 1
#define ENABLE_RESOURCE_USAGE 1
#define ENABLE_RESOURCE_USAGE 1
#define ENABLE_RESOURCE_USAGE 1
#define ENABLE_RESOURCE_USAGE 1
#define ENABLE_RESOURCE_USAGE 1
#define ENABLE_RUBBER_BANDING 0
#define ENABLE_RUBBER_BANDING 0
#define ENABLE_RUBBER_BANDING 0
#define ENABLE_RUBBER_BANDING 0
#define ENABLE_RUBBER_BANDING 0
#define ENABLE_RUBBER_BANDING 0
#define ENABLE_SAMPLING_PROFILER 1
#define ENABLE_SAMPLING_PROFILER 1
#define ENABLE_SAMPLING_PROFILER 1
#define ENABLE_SAMPLING_PROFILER 1
#define ENABLE_SAMPLING_PROFILER 1
#define ENABLE_SAMPLING_PROFILER 1
#define ENABLE_SANDBOX_EXTENSIONS 0
#define ENABLE_SANDBOX_EXTENSIONS 0
#define ENABLE_SANDBOX_EXTENSIONS 0
#define ENABLE_SANDBOX_EXTENSIONS 0
#define ENABLE_SANDBOX_EXTENSIONS 0
#define ENABLE_SANDBOX_EXTENSIONS 0
#define ENABLE_SERVER_PRECONNECT 0
#define ENABLE_SERVER_PRECONNECT 0
#define ENABLE_SERVER_PRECONNECT 0
#define ENABLE_SERVER_PRECONNECT 0
#define ENABLE_SERVER_PRECONNECT 0
#define ENABLE_SERVER_PRECONNECT 0
#define ENABLE_SERVICE_CONTROLS 0
#define ENABLE_SERVICE_CONTROLS 0
#define ENABLE_SERVICE_CONTROLS 0
#define ENABLE_SERVICE_CONTROLS 0
#define ENABLE_SERVICE_CONTROLS 0
#define ENABLE_SERVICE_CONTROLS 0
#define ENABLE_SERVICE_WORKER 0
#define ENABLE_SERVICE_WORKER 0
#define ENABLE_SERVICE_WORKER 0
#define ENABLE_SERVICE_WORKER 0
#define ENABLE_SERVICE_WORKER 0
#define ENABLE_SERVICE_WORKER 0
#define ENABLE_SHAREABLE_RESOURCE 0
#define ENABLE_SHAREABLE_RESOURCE 0
#define ENABLE_SHAREABLE_RESOURCE 0
#define ENABLE_SHAREABLE_RESOURCE 0
#define ENABLE_SHAREABLE_RESOURCE 0
#define ENABLE_SHAREABLE_RESOURCE 0
#define ENABLE_SINGLE_THREADED_VM_ENTRY_SCOPE 1
#define ENABLE_SINGLE_THREADED_VM_ENTRY_SCOPE 1
#define ENABLE_SMOOTH_SCROLLING 1
#define ENABLE_SMOOTH_SCROLLING 1
#define ENABLE_SMOOTH_SCROLLING 1
#define ENABLE_SMOOTH_SCROLLING 1
#define ENABLE_SMOOTH_SCROLLING 1
#define ENABLE_SMOOTH_SCROLLING 1
#define ENABLE_SPEECH_SYNTHESIS 0
#define ENABLE_SPEECH_SYNTHESIS 0
#define ENABLE_SPEECH_SYNTHESIS 0
#define ENABLE_SPEECH_SYNTHESIS 0
#define ENABLE_SPEECH_SYNTHESIS 0
#define ENABLE_SPEECH_SYNTHESIS 0
#define ENABLE_SPELLCHECK 0
#define ENABLE_SPELLCHECK 0
#define ENABLE_SPELLCHECK 0
#define ENABLE_SPELLCHECK 0
#define ENABLE_SPELLCHECK 0
#define ENABLE_SPELLCHECK 0
#define ENABLE_STATIC_JSC 1
#define ENABLE_TELEPHONE_NUMBER_DETECTION 0
#define ENABLE_TELEPHONE_NUMBER_DETECTION 0
#define ENABLE_TELEPHONE_NUMBER_DETECTION 0
#define ENABLE_TELEPHONE_NUMBER_DETECTION 0
#define ENABLE_TELEPHONE_NUMBER_DETECTION 0
#define ENABLE_TELEPHONE_NUMBER_DETECTION 0
#define ENABLE_TEXT_AUTOSIZING 0
#define ENABLE_TEXT_AUTOSIZING 0
#define ENABLE_TEXT_AUTOSIZING 0
#define ENABLE_TEXT_AUTOSIZING 0
#define ENABLE_TEXT_AUTOSIZING 0
#define ENABLE_TEXT_AUTOSIZING 0
#define ENABLE_THUNDER 0
#define ENABLE_THUNDER 0
#define ENABLE_THUNDER 0
#define ENABLE_THUNDER 0
#define ENABLE_THUNDER 0
#define ENABLE_THUNDER 0
#define ENABLE_TOUCH_EVENTS 0
#define ENABLE_TOUCH_EVENTS 0
#define ENABLE_TOUCH_EVENTS 0
#define ENABLE_TOUCH_EVENTS 0
#define ENABLE_TOUCH_EVENTS 0
#define ENABLE_TOUCH_EVENTS 0
#define ENABLE_TRACKING_PREVENTION 0
#define ENABLE_TRACKING_PREVENTION 0
#define ENABLE_TRACKING_PREVENTION 0
#define ENABLE_TRACKING_PREVENTION 0
#define ENABLE_TRACKING_PREVENTION 0
#define ENABLE_TRACKING_PREVENTION 0
#define ENABLE_UNIFIED_BUILDS 1
#define ENABLE_UNIFIED_BUILDS 1
#define ENABLE_UNIFIED_BUILDS 1
#define ENABLE_UNIFIED_BUILDS 1
#define ENABLE_UNIFIED_BUILDS 1
#define ENABLE_UNIFIED_BUILDS 1
#define ENABLE_USER_MESSAGE_HANDLERS 1
#define ENABLE_USER_MESSAGE_HANDLERS 1
#define ENABLE_USER_MESSAGE_HANDLERS 1
#define ENABLE_USER_MESSAGE_HANDLERS 1
#define ENABLE_USER_MESSAGE_HANDLERS 1
#define ENABLE_USER_MESSAGE_HANDLERS 1
#define ENABLE_VARIATION_FONTS 0
#define ENABLE_VARIATION_FONTS 0
#define ENABLE_VARIATION_FONTS 0
#define ENABLE_VARIATION_FONTS 0
#define ENABLE_VARIATION_FONTS 0
#define ENABLE_VARIATION_FONTS 0
#define ENABLE_VIDEO 1
#define ENABLE_VIDEO 1
#define ENABLE_VIDEO 1
#define ENABLE_VIDEO 1
#define ENABLE_VIDEO 1
#define ENABLE_VIDEO 1
#define ENABLE_VIDEO_PRESENTATION_MODE 0
#define ENABLE_VIDEO_PRESENTATION_MODE 0
#define ENABLE_VIDEO_PRESENTATION_MODE 0
#define ENABLE_VIDEO_PRESENTATION_MODE 0
#define ENABLE_VIDEO_PRESENTATION_MODE 0
#define ENABLE_VIDEO_PRESENTATION_MODE 0
#define ENABLE_VIDEO_USES_ELEMENT_FULLSCREEN 1
#define ENABLE_VIDEO_USES_ELEMENT_FULLSCREEN 1
#define ENABLE_VIDEO_USES_ELEMENT_FULLSCREEN 1
#define ENABLE_VIDEO_USES_ELEMENT_FULLSCREEN 1
#define ENABLE_VIDEO_USES_ELEMENT_FULLSCREEN 1
#define ENABLE_VIDEO_USES_ELEMENT_FULLSCREEN 1
#define ENABLE_WEBASSEMBLY 0
#define ENABLE_WEBASSEMBLY 0
#define ENABLE_WEBASSEMBLY 0
#define ENABLE_WEBASSEMBLY 0
#define ENABLE_WEBASSEMBLY 0
#define ENABLE_WEBASSEMBLY 0
#define ENABLE_WEBASSEMBLY_BBQJIT 0
#define ENABLE_WEBASSEMBLY_BBQJIT 0
#define ENABLE_WEBASSEMBLY_BBQJIT 0
#define ENABLE_WEBASSEMBLY_BBQJIT 0
#define ENABLE_WEBASSEMBLY_BBQJIT 0
#define ENABLE_WEBASSEMBLY_BBQJIT 0
#define ENABLE_WEBASSEMBLY_OMGJIT 0
#define ENABLE_WEBASSEMBLY_OMGJIT 0
#define ENABLE_WEBASSEMBLY_OMGJIT 0
#define ENABLE_WEBASSEMBLY_OMGJIT 0
#define ENABLE_WEBASSEMBLY_OMGJIT 0
#define ENABLE_WEBASSEMBLY_OMGJIT 0
#define ENABLE_WEBDRIVER 0
#define ENABLE_WEBDRIVER 0
#define ENABLE_WEBDRIVER 0
#define ENABLE_WEBDRIVER 0
#define ENABLE_WEBDRIVER 0
#define ENABLE_WEBDRIVER 0
#define ENABLE_WEBDRIVER_KEYBOARD_GRAPHEME_CLUSTERS 0
#define ENABLE_WEBDRIVER_KEYBOARD_GRAPHEME_CLUSTERS 0
#define ENABLE_WEBDRIVER_KEYBOARD_GRAPHEME_CLUSTERS 0
#define ENABLE_WEBDRIVER_KEYBOARD_GRAPHEME_CLUSTERS 0
#define ENABLE_WEBDRIVER_KEYBOARD_GRAPHEME_CLUSTERS 0
#define ENABLE_WEBDRIVER_KEYBOARD_GRAPHEME_CLUSTERS 0
#define ENABLE_WEBDRIVER_KEYBOARD_INTERACTIONS 0
#define ENABLE_WEBDRIVER_KEYBOARD_INTERACTIONS 0
#define ENABLE_WEBDRIVER_KEYBOARD_INTERACTIONS 0
#define ENABLE_WEBDRIVER_KEYBOARD_INTERACTIONS 0
#define ENABLE_WEBDRIVER_KEYBOARD_INTERACTIONS 0
#define ENABLE_WEBDRIVER_KEYBOARD_INTERACTIONS 0
#define ENABLE_WEBDRIVER_MOUSE_INTERACTIONS 0
#define ENABLE_WEBDRIVER_MOUSE_INTERACTIONS 0
#define ENABLE_WEBDRIVER_MOUSE_INTERACTIONS 0
#define ENABLE_WEBDRIVER_MOUSE_INTERACTIONS 0
#define ENABLE_WEBDRIVER_MOUSE_INTERACTIONS 0
#define ENABLE_WEBDRIVER_MOUSE_INTERACTIONS 0
#define ENABLE_WEBDRIVER_TOUCH_INTERACTIONS 0
#define ENABLE_WEBDRIVER_TOUCH_INTERACTIONS 0
#define ENABLE_WEBDRIVER_TOUCH_INTERACTIONS 0
#define ENABLE_WEBDRIVER_TOUCH_INTERACTIONS 0
#define ENABLE_WEBDRIVER_TOUCH_INTERACTIONS 0
#define ENABLE_WEBDRIVER_TOUCH_INTERACTIONS 0
#define ENABLE_WEBDRIVER_WHEEL_INTERACTIONS 0
#define ENABLE_WEBDRIVER_WHEEL_INTERACTIONS 0
#define ENABLE_WEBDRIVER_WHEEL_INTERACTIONS 0
#define ENABLE_WEBDRIVER_WHEEL_INTERACTIONS 0
#define ENABLE_WEBDRIVER_WHEEL_INTERACTIONS 0
#define ENABLE_WEBDRIVER_WHEEL_INTERACTIONS 0
#define ENABLE_WEBGL 0
#define ENABLE_WEBGL 0
#define ENABLE_WEBGL 0
#define ENABLE_WEBGL 0
#define ENABLE_WEBGL 0
#define ENABLE_WEBGL 0
#define ENABLE_WEBXR 0
#define ENABLE_WEBXR 0
#define ENABLE_WEBXR 0
#define ENABLE_WEBXR 0
#define ENABLE_WEBXR 0
#define ENABLE_WEBXR 0
#define ENABLE_WEB_API_STATISTICS 0
#define ENABLE_WEB_API_STATISTICS 0
#define ENABLE_WEB_API_STATISTICS 0
#define ENABLE_WEB_API_STATISTICS 0
#define ENABLE_WEB_API_STATISTICS 0
#define ENABLE_WEB_API_STATISTICS 0
#define ENABLE_WEB_AUDIO 1
#define ENABLE_WEB_AUDIO 1
#define ENABLE_WEB_AUDIO 1
#define ENABLE_WEB_AUDIO 1
#define ENABLE_WEB_AUDIO 1
#define ENABLE_WEB_AUDIO 1
#define ENABLE_WEB_AUTHN 0
#define ENABLE_WEB_AUTHN 0
#define ENABLE_WEB_AUTHN 0
#define ENABLE_WEB_AUTHN 0
#define ENABLE_WEB_AUTHN 0
#define ENABLE_WEB_AUTHN 0
#define ENABLE_WEB_CODECS 0
#define ENABLE_WEB_CODECS 0
#define ENABLE_WEB_CODECS 0
#define ENABLE_WEB_CODECS 0
#define ENABLE_WEB_CODECS 0
#define ENABLE_WEB_CODECS 0
#define ENABLE_WEB_CRYPTO 1
#define ENABLE_WEB_CRYPTO 1
#define ENABLE_WEB_CRYPTO 1
#define ENABLE_WEB_CRYPTO 1
#define ENABLE_WEB_CRYPTO 1
#define ENABLE_WEB_CRYPTO 1
#define ENABLE_WEB_RTC 0
#define ENABLE_WEB_RTC 0
#define ENABLE_WEB_RTC 0
#define ENABLE_WEB_RTC 0
#define ENABLE_WEB_RTC 0
#define ENABLE_WEB_RTC 0
#define ENABLE_WIRELESS_PLAYBACK_TARGET 0
#define ENABLE_WIRELESS_PLAYBACK_TARGET 0
#define ENABLE_WIRELESS_PLAYBACK_TARGET 0
#define ENABLE_WIRELESS_PLAYBACK_TARGET 0
#define ENABLE_WIRELESS_PLAYBACK_TARGET 0
#define ENABLE_WIRELESS_PLAYBACK_TARGET 0
#define ENABLE_XSLT 1
#define ENABLE_XSLT 1
#define ENABLE_XSLT 1
#define ENABLE_XSLT 1
#define ENABLE_XSLT 1
#define ENABLE_XSLT 1
#define HAVE_ALIGNED_MALLOC 1
#define HAVE_ERRNO_H 1
#define HAVE_FEATURES_H 0
#define HAVE_LANGINFO_H 0
#define HAVE_LINUX_MEMFD_H 0
#define HAVE_LOCALTIME_R 0
#define HAVE_MALLOC_TRIM 0
#define HAVE_MAP_ALIGNED 0
#define HAVE_MMAP 0
#define HAVE_PTHREAD_MAIN_NP 0
#define HAVE_PTHREAD_NP_H 0
#define HAVE_REGEX_H 0
#define HAVE_SHM_ANON 0
#define HAVE_SIGNAL_H 0
#define HAVE_STATX 0
#define HAVE_STAT_BIRTHTIME 0
#define HAVE_STRNSTR 0
#define HAVE_SYS_PARAM_H 0
#define HAVE_SYS_TIMEB_H 1
#define HAVE_SYS_TIME_H 0
#define HAVE_TIMEGM 0
#define HAVE_TIMINGSAFE_BCMP 0
#define HAVE_TM_GMTOFF 0
#define HAVE_TM_ZONE 0
#define HAVE_VASPRINTF 0
#define JS_NO_EXPORT 1
#define USE_64KB_PAGE_BLOCK 0
#define USE_ALLOW_LINE_AND_COLUMN_NUMBER_IN_BUILTINS 1
#define USE_AVIF 1
#define USE_AVIF 1
#define USE_AVIF 1
#define USE_AVIF 1
#define USE_AVIF 1
#define USE_AVIF 1
#define USE_BUN_JSC_ADDITIONS 1
#define USE_BUN_JSC_ADDITIONS 1
#define USE_GENERIC_EVENT_LOOP 1
#define USE_INSPECTOR_SOCKET_SERVER 1
#define USE_ISO_MALLOC 1
#define USE_ISO_MALLOC 1
#define USE_ISO_MALLOC 1
#define USE_ISO_MALLOC 1
#define USE_ISO_MALLOC 1
#define USE_ISO_MALLOC 1
#define USE_JPEGXL 1
#define USE_JPEGXL 1
#define USE_JPEGXL 1
#define USE_JPEGXL 1
#define USE_JPEGXL 1
#define USE_JPEGXL 1
#define USE_SYSTEM_MALLOC 1
#define USE_SYSTEM_MALLOC 1
#define USE_SYSTEM_MALLOC 1
#define USE_SYSTEM_MALLOC 1
#define USE_SYSTEM_MALLOC 1
#define USE_SYSTEM_MALLOC 1
#define USE_UNIX_DOMAIN_SOCKETS 1
#define WTF_DEFAULT_EVENT_LOOP 0
#endif /* CMAKECONFIG_H */

View File

@@ -339,10 +339,13 @@ String CryptoKeyOKP::generateJwkX() const
ASSERT(type() == CryptoKeyType::Private);
if (namedCurve() == NamedCurve::Ed25519)
return Bun::base64URLEncodeToString(WTFMove(ed25519PublicFromPrivate(const_cast<KeyMaterial&>(m_data))));
// TODO(@paperdave 2023-10-19): i removed WTFMove from ed25519PublicFromPrivate() as per MSVC compiler error.
// We need to evaluate if that is the proper fix here.
return Bun::base64URLEncodeToString(ed25519PublicFromPrivate(const_cast<KeyMaterial&>(m_data)));
ASSERT(namedCurve() == NamedCurve::X25519);
return Bun::base64URLEncodeToString(WTFMove(x25519PublicFromPrivate(const_cast<KeyMaterial&>(m_data))));
// TODO(@paperdave 2023-10-19): see above
return Bun::base64URLEncodeToString(x25519PublicFromPrivate(const_cast<KeyMaterial&>(m_data)));
}
CryptoKeyOKP::KeyMaterial CryptoKeyOKP::platformExportRaw() const

View File

@@ -1,8 +1,8 @@
// musl as a whole is licensed under the following standard MIT license:
//
//
// ----------------------------------------------------------------------
// Copyright © 2005-2020 Rich Felker, et al.
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
@@ -10,10 +10,10 @@
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
@@ -22,9 +22,9 @@
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ----------------------------------------------------------------------
//
//
// Authors/contributors include:
//
//
// A. Wilcox
// Ada Worcester
// Alex Dowad
@@ -107,16 +107,16 @@
// Will Dietz
// William Haddon
// William Pitcock
//
//
// Portions of this software are derived from third-party works licensed
// under terms compatible with the above MIT license:
//
//
// The TRE regular expression implementation (src/regex/reg* and
// src/regex/tre*) is Copyright © 2001-2008 Ville Laurikari and licensed
// under a 2-clause BSD license (license text in the source files). The
// included version has been heavily modified by Rich Felker in 2012, in
// the interests of size, simplicity, and namespace cleanliness.
//
//
// Much of the math library code (src/math/* and src/complex/*) is
// Copyright © 1993,2004 Sun Microsystems or
// Copyright © 2003-2011 David Schultz or
@@ -126,40 +126,40 @@
// Copyright © 2017-2018 Arm Limited
// and labelled as such in comments in the individual source files. All
// have been licensed under extremely permissive terms.
//
//
// The ARM memcpy code (src/string/arm/memcpy.S) is Copyright © 2008
// The Android Open Source Project and is licensed under a two-clause BSD
// license. It was taken from Bionic libc, used on Android.
//
//
// The AArch64 memcpy and memset code (src/string/aarch64/*) are
// Copyright © 1999-2019, Arm Limited.
//
//
// The implementation of DES for crypt (src/crypt/crypt_des.c) is
// Copyright © 1994 David Burren. It is licensed under a BSD license.
//
//
// The implementation of blowfish crypt (src/crypt/crypt_blowfish.c) was
// originally written by Solar Designer and placed into the public
// domain. The code also comes with a fallback permissive license for use
// in jurisdictions that may not recognize the public domain.
//
//
// The smoothsort implementation (src/stdlib/qsort.c) is Copyright © 2011
// Valentin Ochs and is licensed under an MIT-style license.
//
//
// The x86_64 port was written by Nicholas J. Kain and is licensed under
// the standard MIT terms.
//
//
// The mips and microblaze ports were originally written by Richard
// Pennington for use in the ellcc project. The original code was adapted
// by Rich Felker for build system and code conventions during upstream
// integration. It is licensed under the standard MIT terms.
//
//
// The mips64 port was contributed by Imagination Technologies and is
// licensed under the standard MIT terms.
//
//
// The powerpc port was also originally written by Richard Pennington,
// and later supplemented and integrated by John Spencer. It is licensed
// under the standard MIT terms.
//
//
// All other files which have no copyright comments are original works
// produced specifically for use as part of this library, written either
// by Rich Felker, the main author of the library, or by one or more
@@ -167,14 +167,14 @@
// can be found in the git version control history of the project. The
// omission of copyright and license comments in each file is in the
// interest of source tree size.
//
//
// In addition, permission is hereby granted for all public header files
// (include/* and arch/*/bits/*) and crt files intended to be linked into
// applications (crt/*, ldso/dlstart.c, and arch/*/crt_arch.h) to omit
// the copyright notice and permission notice otherwise required by the
// license, and to use these files without any requirement of
// attribution. These files include substantial contributions from:
//
//
// Bobby Bingham
// John Spencer
// Nicholas J. Kain
@@ -182,9 +182,9 @@
// Richard Pennington
// Stefan Kristiansson
// Szabolcs Nagy
//
//
// all of whom have explicitly granted such permission.
//
//
// This file previously contained text expressing a belief that most of
// the files covered by the above exception were sufficiently trivial not
// to be subject to copyright, resulting in confusion over whether it
@@ -195,149 +195,173 @@
#include <windows.h>
#include <stdint.h>
static char *twobyte_memmem(const unsigned char *h, size_t k, const unsigned char *n)
static char* twobyte_memmem(const unsigned char* h, size_t k, const unsigned char* n)
{
uint16_t nw = n[0]<<8 | n[1], hw = h[0]<<8 | h[1];
for (h+=2, k-=2; k; k--, hw = hw<<8 | *h++)
if (hw == nw) return (char *)h-2;
return hw == nw ? (char *)h-2 : 0;
uint16_t nw = n[0] << 8 | n[1], hw = h[0] << 8 | h[1];
for (h += 2, k -= 2; k; k--, hw = hw << 8 | *h++)
if (hw == nw)
return (char*)h - 2;
return hw == nw ? (char*)h - 2 : 0;
}
static char *threebyte_memmem(const unsigned char *h, size_t k, const unsigned char *n)
static char* threebyte_memmem(const unsigned char* h, size_t k, const unsigned char* n)
{
uint32_t nw = (uint32_t)n[0]<<24 | n[1]<<16 | n[2]<<8;
uint32_t hw = (uint32_t)h[0]<<24 | h[1]<<16 | h[2]<<8;
for (h+=3, k-=3; k; k--, hw = (hw|*h++)<<8)
if (hw == nw) return (char *)h-3;
return hw == nw ? (char *)h-3 : 0;
uint32_t nw = (uint32_t)n[0] << 24 | n[1] << 16 | n[2] << 8;
uint32_t hw = (uint32_t)h[0] << 24 | h[1] << 16 | h[2] << 8;
for (h += 3, k -= 3; k; k--, hw = (hw | *h++) << 8)
if (hw == nw)
return (char*)h - 3;
return hw == nw ? (char*)h - 3 : 0;
}
static char *fourbyte_memmem(const unsigned char *h, size_t k, const unsigned char *n)
static char* fourbyte_memmem(const unsigned char* h, size_t k, const unsigned char* n)
{
uint32_t nw = (uint32_t)n[0]<<24 | n[1]<<16 | n[2]<<8 | n[3];
uint32_t hw = (uint32_t)h[0]<<24 | h[1]<<16 | h[2]<<8 | h[3];
for (h+=4, k-=4; k; k--, hw = hw<<8 | *h++)
if (hw == nw) return (char *)h-4;
return hw == nw ? (char *)h-4 : 0;
uint32_t nw = (uint32_t)n[0] << 24 | n[1] << 16 | n[2] << 8 | n[3];
uint32_t hw = (uint32_t)h[0] << 24 | h[1] << 16 | h[2] << 8 | h[3];
for (h += 4, k -= 4; k; k--, hw = hw << 8 | *h++)
if (hw == nw)
return (char*)h - 4;
return hw == nw ? (char*)h - 4 : 0;
}
#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)<(b)?(a):(b))
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define BITOP(a,b,op) \
((a)[(size_t)(b)/(8*sizeof *(a))] op (size_t)1<<((size_t)(b)%(8*sizeof *(a))))
#define BITOP(a, b, op) \
((a)[(size_t)(b) / (8 * sizeof *(a))] op(size_t) 1 << ((size_t)(b) % (8 * sizeof *(a))))
static char *twoway_memmem(const unsigned char *h, const unsigned char *z, const unsigned char *n, size_t l)
static char* twoway_memmem(const unsigned char* h, const unsigned char* z, const unsigned char* n, size_t l)
{
size_t i, ip, jp, k, p, ms, p0, mem, mem0;
size_t byteset[32 / sizeof(size_t)] = { 0 };
size_t shift[256];
size_t i, ip, jp, k, p, ms, p0, mem, mem0;
size_t byteset[32 / sizeof(size_t)] = { 0 };
size_t shift[256];
/* Computing length of needle and fill shift table */
for (i=0; i<l; i++)
BITOP(byteset, n[i], |=), shift[n[i]] = i+1;
/* Computing length of needle and fill shift table */
for (i = 0; i < l; i++)
BITOP(byteset, n[i], |=), shift[n[i]] = i + 1;
/* Compute maximal suffix */
ip = -1; jp = 0; k = p = 1;
while (jp+k<l) {
if (n[ip+k] == n[jp+k]) {
if (k == p) {
jp += p;
k = 1;
} else k++;
} else if (n[ip+k] > n[jp+k]) {
jp += k;
k = 1;
p = jp - ip;
} else {
ip = jp++;
k = p = 1;
}
}
ms = ip;
p0 = p;
/* Compute maximal suffix */
ip = -1;
jp = 0;
k = p = 1;
while (jp + k < l) {
if (n[ip + k] == n[jp + k]) {
if (k == p) {
jp += p;
k = 1;
} else
k++;
} else if (n[ip + k] > n[jp + k]) {
jp += k;
k = 1;
p = jp - ip;
} else {
ip = jp++;
k = p = 1;
}
}
ms = ip;
p0 = p;
/* And with the opposite comparison */
ip = -1; jp = 0; k = p = 1;
while (jp+k<l) {
if (n[ip+k] == n[jp+k]) {
if (k == p) {
jp += p;
k = 1;
} else k++;
} else if (n[ip+k] < n[jp+k]) {
jp += k;
k = 1;
p = jp - ip;
} else {
ip = jp++;
k = p = 1;
}
}
if (ip+1 > ms+1) ms = ip;
else p = p0;
/* And with the opposite comparison */
ip = -1;
jp = 0;
k = p = 1;
while (jp + k < l) {
if (n[ip + k] == n[jp + k]) {
if (k == p) {
jp += p;
k = 1;
} else
k++;
} else if (n[ip + k] < n[jp + k]) {
jp += k;
k = 1;
p = jp - ip;
} else {
ip = jp++;
k = p = 1;
}
}
if (ip + 1 > ms + 1)
ms = ip;
else
p = p0;
/* Periodic needle? */
if (memcmp(n, n+p, ms+1)) {
mem0 = 0;
p = MAX(ms, l-ms-1) + 1;
} else mem0 = l-p;
mem = 0;
/* Periodic needle? */
if (memcmp(n, n + p, ms + 1)) {
mem0 = 0;
p = MAX(ms, l - ms - 1) + 1;
} else
mem0 = l - p;
mem = 0;
/* Search loop */
for (;;) {
/* If remainder of haystack is shorter than needle, done */
if (z-h < l) return 0;
/* Search loop */
for (;;) {
/* If remainder of haystack is shorter than needle, done */
if (z - h < l)
return 0;
/* Check last byte first; advance by shift on mismatch */
if (BITOP(byteset, h[l-1], &)) {
k = l-shift[h[l-1]];
if (k) {
if (k < mem) k = mem;
h += k;
mem = 0;
continue;
}
} else {
h += l;
mem = 0;
continue;
}
/* Check last byte first; advance by shift on mismatch */
if (BITOP(byteset, h[l - 1], &)) {
k = l - shift[h[l - 1]];
if (k) {
if (k < mem)
k = mem;
h += k;
mem = 0;
continue;
}
} else {
h += l;
mem = 0;
continue;
}
/* Compare right half */
for (k=MAX(ms+1,mem); k<l && n[k] == h[k]; k++);
if (k < l) {
h += k-ms;
mem = 0;
continue;
}
/* Compare left half */
for (k=ms+1; k>mem && n[k-1] == h[k-1]; k--);
if (k <= mem) return (char *)h;
h += p;
mem = mem0;
}
/* Compare right half */
for (k = MAX(ms + 1, mem); k < l && n[k] == h[k]; k++)
;
if (k < l) {
h += k - ms;
mem = 0;
continue;
}
/* Compare left half */
for (k = ms + 1; k > mem && n[k - 1] == h[k - 1]; k--)
;
if (k <= mem)
return (char*)h;
h += p;
mem = mem0;
}
}
extern void *memmem(const void *h0, size_t k, const void *n0, size_t l)
extern void* memmem(const void* h0, size_t k, const void* n0, size_t l)
{
const unsigned char *h = h0, *n = n0;
const unsigned char *h = h0, *n = n0;
/* Return immediately on empty needle */
if (!l) return (void *)h;
/* Return immediately on empty needle */
if (!l)
return (void*)h;
/* Return immediately when needle is longer than haystack */
if (k<l) return 0;
/* Return immediately when needle is longer than haystack */
if (k < l)
return 0;
/* Use faster algorithms for short needles */
h = memchr(h0, *n, k);
if (!h || l==1) return (void *)h;
k -= h - (const unsigned char *)h0;
if (k<l) return 0;
if (l==2) return twobyte_memmem(h, k, n);
if (l==3) return threebyte_memmem(h, k, n);
if (l==4) return fourbyte_memmem(h, k, n);
/* Use faster algorithms for short needles */
h = memchr(h0, *n, k);
if (!h || l == 1)
return (void*)h;
k -= h - (const unsigned char*)h0;
if (k < l)
return 0;
if (l == 2)
return twobyte_memmem(h, k, n);
if (l == 3)
return threebyte_memmem(h, k, n);
if (l == 4)
return fourbyte_memmem(h, k, n);
return twoway_memmem(h, h+k, n, l);
return twoway_memmem(h, h + k, n, l);
}
#endif