From: chris <spamoff.danx@ntlworld.com>
Subject: C Integers -> Booleans: shortcut?
Date: Sun, 28 Sep 2003 17:46:40 +0100
Date: 2003-09-28T17:46:40+01:00 [thread overview]
Message-ID: <7bEdb.1944$QH3.1487@newsfep4-winn.server.ntli.net> (raw)
Hi,
Can you (in general) import a function taking/returning a C integer and
treat it like a boolean for import? Let the compiler deal with the
difference?
Like say,
function is_broke (something : sometype) return Boolean;
pragma Import (C, Is_Broke, "is_broke");
with is_broke actually,
int is_broke (sometype something);
instead of going through
function is_broke (something : sometype) return Boolean is
begin
return c_is_broke (something) /= 0;
end is_broke;
Cheers,
Chris
next reply other threads:[~2003-09-28 16:46 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-09-28 16:46 chris [this message]
2003-09-28 17:15 ` C Integers -> Booleans: shortcut? Simon Wright
2003-09-28 18:17 ` chris
2003-09-29 20:19 ` Randy Brukardt
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox