comp.lang.ada
 help / color / mirror / Atom feed
* Interfacing to C: API with macros
@ 2007-06-12 20:17 Maciej Sobczak
  2007-06-12 20:25 ` Lutz Donnerhacke
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Maciej Sobczak @ 2007-06-12 20:17 UTC (permalink / raw)


Yet Another Problem (YAP): consider a C function that is defined
together with some helper macros. Motivating example: select(2) system
call, with its FD_XXX helper macros.

(it is unspecified whether FD_XXX helpers are macros or functions, but
we can assume the worst)

There is no way to pragma Import(C, FD_SET) and the binary layout of
fd_set data structure is not specified, so we cannot fake it with Ada.

Again, the straightforward solution: thin wrapper in C, that itself is
simple enough to be easily imported by Ada code.

Again: is this THE solution?

Looks like in order to write any nontrivial system software the poor
Ada programmer has to start with an awful lots of wrappers - where is
maintainability and productivity when you need them? ;-)

--
Maciej Sobczak
http://www.msobczak.com/




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-06-13 14:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-06-12 20:17 Interfacing to C: API with macros Maciej Sobczak
2007-06-12 20:25 ` Lutz Donnerhacke
2007-06-13  0:18 ` tmoran
2007-06-13 14:06 ` Steve

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