Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit e61d08a

Browse files
authored
Remove number of arguments from defining Dart FFI (#50153)
The number of arguments are not used. And also, even if we need it in the future, they can be derived at compile time: ```cpp template <typename T> struct function_traits; template <typename Ret, typename... Args> struct function_traits<Ret(Args...)> { using params = std::tuple<Args...>; }; template <typename T> constexpr std::size_t get_parameter_count() { return std::tuple_size<typename function_traits<T>::params>::value; } template <typename T> struct member_function_traits; template <typename C, typename Ret, typename... Args> struct member_function_traits<Ret(C::*)(Args...)> { using params = std::tuple<Args...>; }; template <typename T> constexpr std::size_t get_member_function_parameter_count() { return std::tuple_size<typename member_function_traits<T>::params>::value; } ``` (I got the code above with ChatGPT but I verified that they work) [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
1 parent d0db4c4 commit e61d08a

File tree

3 files changed

+238
-237
lines changed

3 files changed

+238
-237
lines changed

fml/platform/fuchsia/log_interest_listener.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ class LogInterestListener {
3434

3535
} // namespace fml
3636

37-
#endif // FLUTTER_FML_PLATFORM_FUCHSIA_LOG_STATE_H_
37+
#endif // FLUTTER_FML_PLATFORM_FUCHSIA_LOG_INTEREST_LISTENER_H_

fml/platform/fuchsia/log_state.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5-
#ifndef FLUTTER_FML_PLATFORM_FUCHSIA_LOG_CONNECTION_H_
6-
#define FLUTTER_FML_PLATFORM_FUCHSIA_LOG_CONNECTION_H_
5+
#ifndef FLUTTER_FML_PLATFORM_FUCHSIA_LOG_STATE_H_
6+
#define FLUTTER_FML_PLATFORM_FUCHSIA_LOG_STATE_H_
77

88
#include <fidl/fuchsia.logger/cpp/fidl.h>
99
#include <lib/fidl/cpp/wire/internal/transport_channel.h>
@@ -52,4 +52,4 @@ class LogState {
5252

5353
} // namespace fml
5454

55-
#endif // FLUTTER_FML_PLATFORM_FUCHSIA_LOG_CONNECTION_H_
55+
#endif // FLUTTER_FML_PLATFORM_FUCHSIA_LOG_STATE_H_

0 commit comments

Comments
 (0)