diff --git a/crates/samples/components/json_validator_client/src/client.cpp b/crates/samples/components/json_validator_client/src/client.cpp index 26d58aaeb7..b9ef1db984 100644 --- a/crates/samples/components/json_validator_client/src/client.cpp +++ b/crates/samples/components/json_validator_client/src/client.cpp @@ -10,19 +10,17 @@ typedef HRESULT (__stdcall *ValidateJson)(uintptr_t handle, char const* value, s typedef void (__stdcall *CloseJsonValidator)(uintptr_t handle); extern "C" { - void __stdcall CoTaskMemFree(void* ptr); - void __stdcall client() { auto library = LoadLibraryExW(L"sample_component_json_validator.dll", 0, LOAD_LIBRARY_SEARCH_DEFAULT_DIRS); assert(library != 0); - auto create = (CreateJsonValidator)GetProcAddress(library, "CreateJsonValidator"); + auto create = reinterpret_cast(GetProcAddress(library, "CreateJsonValidator")); assert(create); - auto validate = (ValidateJson)GetProcAddress(library, "ValidateJson"); + auto validate = reinterpret_cast(GetProcAddress(library, "ValidateJson")); assert(validate); - auto close = (CloseJsonValidator)GetProcAddress(library, "CloseJsonValidator"); + auto close = reinterpret_cast(GetProcAddress(library, "CloseJsonValidator")); assert(close); std::string_view schema = "{\"maxLength\": 5}"; diff --git a/crates/samples/components/json_validator_client/src/lib.rs b/crates/samples/components/json_validator_client/src/lib.rs index c6f84ba608..6f1497b02a 100644 --- a/crates/samples/components/json_validator_client/src/lib.rs +++ b/crates/samples/components/json_validator_client/src/lib.rs @@ -1,3 +1,5 @@ +#![cfg(target_env = "msvc")] + #[test] fn test() { extern "system" {