diff --git a/source/MaaRpc/implement/Controller.cpp b/source/MaaRpc/implement/Controller.cpp index 766f8b4f8..c8438db51 100644 --- a/source/MaaRpc/implement/Controller.cpp +++ b/source/MaaRpc/implement/Controller.cpp @@ -303,9 +303,12 @@ Status ControllerImpl::create_custom( return Status(NOT_FOUND, "id not exists"); } - // build error on macOS - // auto info = std::make_shared(stream, image_impl_); +#if defined(__APPLE__) && defined(__clang__) && __clang_major__ < 16 std::shared_ptr info(new CustomControllerInfo{ stream, image_impl_ }); +#else + // build error on macOS of Apple clang version 15.0.0 (clang-1500.0.40.1) + auto info = std::make_shared(stream, image_impl_); +#endif auto id = make_uuid(); diff --git a/source/MaaRpc/implement/Instance.cpp b/source/MaaRpc/implement/Instance.cpp index 4eecf4e89..23c37782d 100644 --- a/source/MaaRpc/implement/Instance.cpp +++ b/source/MaaRpc/implement/Instance.cpp @@ -104,9 +104,12 @@ Status InstanceImpl::register_custom_recognizer( MAA_GRPC_GET_HANDLE_FROM(this, handle, init().handle) - // build error on macOS - // auto info = std::make_shared(request->init().name(), stream, image_impl_, syncctx_impl_); +#if defined(__APPLE__) && defined(__clang__) && __clang_major__ < 16 std::shared_ptr info(new CustomRecognizerInfo{ request->init().name(), stream, image_impl_, syncctx_impl_ }); +#else + // build error on macOS of Apple clang version 15.0.0 (clang-1500.0.40.1) + auto info = std::make_shared(request->init().name(), stream, image_impl_, syncctx_impl_); +#endif ::maarpc::CustomRecognizerResponse response; stream->Write(response); @@ -232,9 +235,12 @@ Status InstanceImpl::register_custom_action( MAA_GRPC_GET_HANDLE_FROM(this, handle, init().handle) - // build error on macOS - // auto info = std::make_shared(request->init().name(), stream, syncctx_impl_); +#if defined(__APPLE__) && defined(__clang__) && __clang_major__ < 16 std::shared_ptr info(new CustomActionInfo{ request->init().name(), stream, syncctx_impl_ }); +#else + // build error on macOS of Apple clang version 15.0.0 (clang-1500.0.40.1) + auto info = std::make_shared(request->init().name(), stream, syncctx_impl_); +#endif ::maarpc::CustomActionResponse response; stream->Write(response);