From 3736c00dee4347ddded923bf3dc2ee3f56c05030 Mon Sep 17 00:00:00 2001 From: Dillon Nys Date: Thu, 25 Jul 2024 11:02:27 -0700 Subject: [PATCH] Remove temp test code --- packages/native/storage/ffigen.glib.yaml | 6 +++--- .../lib/src/local/local_storage_platform.vm.dart | 13 +++++++------ .../storage/lib/src/native/linux/glib.ffi.dart | 14 ++++++++++++++ .../lib/src/secure/secure_storage_platform.vm.dart | 2 +- 4 files changed, 25 insertions(+), 10 deletions(-) diff --git a/packages/native/storage/ffigen.glib.yaml b/packages/native/storage/ffigen.glib.yaml index bc862aa..d9c1b9d 100644 --- a/packages/native/storage/ffigen.glib.yaml +++ b/packages/native/storage/ffigen.glib.yaml @@ -7,9 +7,9 @@ language: c output: lib/src/native/linux/glib.ffi.dart headers: entry-points: - - /opt/homebrew/Cellar/glib/2.80.3/include/glib-2.0/glib.h - - /opt/homebrew/Cellar/glib/2.80.3/include/glib-2.0/glib-object.h - - /opt/homebrew/Cellar/glib/2.80.3/include/glib-2.0/gio/gio.h + - /usr/include/glib-2.0/glib.h + - /usr/include/glib-2.0/glib-object.h + - /usr/include/glib-2.0/gio/gio.h compiler-opts: # Suppress nullability warnings on macOS - "-Wno-nullability-completeness" diff --git a/packages/native/storage/lib/src/local/local_storage_platform.vm.dart b/packages/native/storage/lib/src/local/local_storage_platform.vm.dart index 3141397..478af3a 100644 --- a/packages/native/storage/lib/src/local/local_storage_platform.vm.dart +++ b/packages/native/storage/lib/src/local/local_storage_platform.vm.dart @@ -5,6 +5,7 @@ import 'package:native_storage/native_storage.dart'; import 'package:native_storage/src/local/local_storage.android.dart'; import 'package:native_storage/src/local/local_storage.linux.dart'; import 'package:native_storage/src/local/local_storage.windows.dart'; +import 'package:native_storage/src/local/local_storage_darwin.dart'; import 'package:native_storage/src/native_storage_base.dart'; import 'package:native_storage/src/secure/secure_storage_platform.vm.dart'; import 'package:native_storage/src/util/rescope.dart'; @@ -17,18 +18,18 @@ abstract base class NativeLocalStoragePlatform extends NativeStorageBase String? namespace, String? scope, }) { - // if (Platform.isMacOS || Platform.isIOS) { - // return LocalStoragePlatformDarwin(namespace: namespace, scope: scope); - // } + if (Platform.isLinux) { + return LocalStorageLinux(namespace: namespace, scope: scope); + } + if (Platform.isMacOS || Platform.isIOS) { + return LocalStoragePlatformDarwin(namespace: namespace, scope: scope); + } if (Platform.isAndroid) { return LocalStoragePlatformAndroid(namespace: namespace, scope: scope); } if (Platform.isWindows) { return LocalStorageWindows(namespace: namespace, scope: scope); } - if (Platform.isLinux || Platform.isMacOS) { - return LocalStorageLinux(namespace: namespace, scope: scope); - } throw UnsupportedError('This platform is not yet supported.'); } diff --git a/packages/native/storage/lib/src/native/linux/glib.ffi.dart b/packages/native/storage/lib/src/native/linux/glib.ffi.dart index 870d32f..08f6735 100644 --- a/packages/native/storage/lib/src/native/linux/glib.ffi.dart +++ b/packages/native/storage/lib/src/native/linux/glib.ffi.dart @@ -1240,6 +1240,20 @@ typedef gboolean = gint; final class _GAllocator extends ffi.Opaque {} +/// GObject: +/// +/// The base object type. +/// +/// All the fields in the `GObject` structure are private to the implementation +/// and should never be accessed directly. +/// +/// Since GLib 2.72, all #GObjects are guaranteed to be aligned to at least the +/// alignment of the largest basic GLib type (typically this is #guint64 or +/// #gdouble). If you need larger alignment for an element in a #GObject, you +/// should allocate it on the heap (aligned), or arrange for your #GObject to be +/// appropriately padded. This guarantee applies to the #GObject (or derived) +/// struct, the #GObjectClass (or derived) struct, and any private data allocated +/// by G_ADD_PRIVATE(). final class GObject extends ffi.Struct { external _GTypeInstance g_type_instance; diff --git a/packages/native/storage/lib/src/secure/secure_storage_platform.vm.dart b/packages/native/storage/lib/src/secure/secure_storage_platform.vm.dart index 1a282e3..b0076c1 100644 --- a/packages/native/storage/lib/src/secure/secure_storage_platform.vm.dart +++ b/packages/native/storage/lib/src/secure/secure_storage_platform.vm.dart @@ -16,7 +16,7 @@ abstract base class NativeSecureStoragePlatform extends NativeStorageBase String? namespace, String? scope, }) { - if (Platform.isLinux || Platform.isMacOS) { + if (Platform.isLinux) { return SecureStorageLinux(namespace: namespace, scope: scope); } if (Platform.isIOS || Platform.isMacOS) {