aboutsummaryrefslogtreecommitdiff
path: root/src/fltk.ads
diff options
context:
space:
mode:
authorJedidiah Barber <contact@jedbarber.id.au>2024-10-13 02:00:32 +1300
committerJedidiah Barber <contact@jedbarber.id.au>2024-10-13 02:00:32 +1300
commit87671a2f2423efacd0b0c4ad0c34c244680ef565 (patch)
treeb581ee812415bd27bed09f0e0c77c4d24619afcf /src/fltk.ads
parentca99321b1f7aa54b435c73f1ec14321dbd989f16 (diff)
Changed System.Address to Integer_Address
Diffstat (limited to 'src/fltk.ads')
-rw-r--r--src/fltk.ads22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/fltk.ads b/src/fltk.ads
index 1bacd6e..8c8922c 100644
--- a/src/fltk.ads
+++ b/src/fltk.ads
@@ -7,7 +7,7 @@ with
private with
Interfaces.C,
- System;
+ System.Storage_Elements;
package FLTK is
@@ -365,16 +365,34 @@ package FLTK is
private
+ package Storage renames System.Storage_Elements;
+ use type Interfaces.C.size_t, Storage.Integer_Address;
+
+
+ Null_Pointer : constant Storage.Integer_Address := Storage.To_Integer (System.Null_Address);
+
+
pragma Linker_Options ("-lfltk");
pragma Linker_Options ("-lfltk_images");
pragma Linker_Options ("-lfltk_gl");
+ function c_pointer_size
+ return Interfaces.C.size_t;
+ pragma Import (C, c_pointer_size, "c_pointer_size");
+
+ -- If this fails then we are on an architecture that for whatever reason
+ -- has significant problems interfacing between C and Ada
+ pragma Assert
+ (c_pointer_size * Interfaces.C.CHAR_BIT = Storage.Integer_Address'Size,
+ "Size of C void pointers and size of Ada address values do not match");
+
+
type Wrapper is new Ada.Finalization.Limited_Controlled with
record
- Void_Ptr : System.Address;
+ Void_Ptr : Storage.Integer_Address;
Needs_Dealloc : Boolean := True;
end record;