comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pushface.org>
Subject: Re: Least Dangerous Way to Do This ?
Date: Mon, 15 Oct 2018 17:05:33 +0100
Date: 2018-10-15T17:05:33+01:00	[thread overview]
Message-ID: <ly1s8rtctu.fsf@pushface.org> (raw)
In-Reply-To: beac86f1-fa15-4719-bfc3-8d0334260906@googlegroups.com

patrick@spellingbeewinnars.org writes:

> I need to interface with automatically generated C. function pointers
> are represented as a pointer to a pointer to a char. This is weird but
> done for pointer arithmetic purposes.

But it's not really a char**, is it!

   procedure Pointers is
      type Procedure_P is access procedure with Convention => C;
      type Procedure_P_P is access Procedure_P;
      P : Procedure_P_P;
      procedure Proc is null with Convention => C;
   begin
      P.all := Proc'Access;
   end Pointers;

You could try something involving Proc'Address, though it's not obvious
that that's mandated to be the address of something that you could
call. Maybe convention C does that.

  parent reply	other threads:[~2018-10-15 16:05 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-15 13:42 Least Dangerous Way to Do This ? patrick
2018-10-15 14:20 ` patrick
2018-10-15 14:51 ` Jacob Sparre Andersen
2018-10-15 16:05 ` Simon Wright [this message]
2018-10-15 19:28   ` patrick
2018-10-15 19:36     ` patrick
2018-10-16 16:07       ` Shark8
2018-10-17  0:09         ` patrick
2018-10-17 20:49           ` Shark8
2018-10-18 13:52             ` patrick
2018-10-15 20:36 ` Randy Brukardt
2018-10-16 22:32   ` patrick
2018-10-17  5:16   ` Petter Fryklund
2018-10-17 21:50     ` Randy Brukardt
2018-10-18  5:24       ` Petter Fryklund
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox