Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade ffi to 1.0.0 #12

Closed
narumi147 opened this issue Feb 21, 2021 · 4 comments
Closed

Upgrade ffi to 1.0.0 #12

narumi147 opened this issue Feb 21, 2021 · 4 comments

Comments

@narumi147
Copy link
Contributor

current master and dev branch of flutter is not compatible with ffi 0.1.3, almost all packages depends on ffi and ffi itself will build failed. It was warning before not error.

...../win32-1.7.4/lib/src/structs.dart:2999:7: Error: Struct 'NLM_SIMULATED_PROFILE_INFO' is empty. Empty structs are undefined behavior.
class NLM_SIMULATED_PROFILE_INFO extends Struct {}                      
      ^                                                                 
...../ffi-0.1.3/lib/src/allocation.dart:47:33: Error: Expected type 'T' to be a valid and instantiated subtype of 'NativeType'.
  final int totalSize = count * sizeOf<T>();

The top level functions free and allocate are moved into abstract class in ffi 1.0.0

@narumi147
Copy link
Contributor Author

maybe related issue
dart-lang/sdk#44622
dart-lang/sdk#44621

@ekibun
Copy link
Owner

ekibun commented Feb 22, 2021

Thanks!

@ekibun ekibun closed this as completed Feb 22, 2021
@narumi147
Copy link
Contributor Author

BTW, when building/hot restart an app with this qjs package, a lot of warnings (mostly number type related like long, int, size_t) will be generated.

Is this usual and allowed for c/c++ program without type cast? I am not familiar with c++, just try to clear the doubts. Thanks.

@Sunbreak
Copy link

Sunbreak commented Feb 24, 2021

Wonderful project!

Have you encounter array problem in Struct, i.e. dart-lang/native#506

// C struct
struct TW_VERSION {
  char[34] info;
}
// dart class
class TW_VERSION extends Stuct {}

I could get the struct address but fail to perform static_cast like operation on it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants