<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Gem #59: Generating Ada bindings for C headers</title>
	<atom:link href="http://www.adacore.com/2009/02/23/gem-59/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.adacore.com/2009/02/23/gem-59/</link>
	<description>AdaCore technology and news</description>
	<lastBuildDate>Mon, 06 Feb 2012 18:59:19 -0500</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Arnaud Charlet</title>
		<link>http://www.adacore.com/2009/02/23/gem-59/comment-page-1/#comment-3386</link>
		<dc:creator>Arnaud Charlet</dc:creator>
		<pubDate>Wed, 25 Feb 2009 17:07:56 +0000</pubDate>
		<guid isPermaLink="false">http://www2.adacore.com/?p=2596#comment-3386</guid>
		<description>Official GCC development is currently held finalizing the GCC 4.4 branch, so no new contribution can be made on trunk at this stage. Once GCC tree is open for contributions, we will submit these changes for inclusion.
GNAT GPL 2009 will also contain this new feature.</description>
		<content:encoded><![CDATA[<p>Official GCC development is currently held finalizing the GCC 4.4 branch, so no new contribution can be made on trunk at this stage. Once GCC tree is open for contributions, we will submit these changes for inclusion.<br />
GNAT GPL 2009 will also contain this new feature.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: qunying</title>
		<link>http://www.adacore.com/2009/02/23/gem-59/comment-page-1/#comment-3385</link>
		<dc:creator>qunying</dc:creator>
		<pubDate>Wed, 25 Feb 2009 17:03:06 +0000</pubDate>
		<guid isPermaLink="false">http://www2.adacore.com/?p=2596#comment-3385</guid>
		<description>Had the feature incorporated into the official GCC? Or a new release of GNAT GPL will have the feature?</description>
		<content:encoded><![CDATA[<p>Had the feature incorporated into the official GCC? Or a new release of GNAT GPL will have the feature?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul Pearson</title>
		<link>http://www.adacore.com/2009/02/23/gem-59/comment-page-1/#comment-3384</link>
		<dc:creator>Paul Pearson</dc:creator>
		<pubDate>Tue, 24 Feb 2009 21:01:32 +0000</pubDate>
		<guid isPermaLink="false">http://www2.adacore.com/?p=2596#comment-3384</guid>
		<description>Thanks, Armaud.  I knew function-like macros would be tricky (one reason they can be so error-prone in C). It looks like the binding generator takes the safe approach.  How very Ada like! ;-)

Yeah, using the binding generator for some small, useful library might make an interesting Gem!</description>
		<content:encoded><![CDATA[<p>Thanks, Armaud.  I knew function-like macros would be tricky (one reason they can be so error-prone in C). It looks like the binding generator takes the safe approach.  How very Ada like! ;-)</p>
<p>Yeah, using the binding generator for some small, useful library might make an interesting Gem!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Arnaud Charlet</title>
		<link>http://www.adacore.com/2009/02/23/gem-59/comment-page-1/#comment-3382</link>
		<dc:creator>Arnaud Charlet</dc:creator>
		<pubDate>Tue, 24 Feb 2009 17:49:36 +0000</pubDate>
		<guid isPermaLink="false">http://www2.adacore.com/?p=2596#comment-3382</guid>
		<description>I forgot to mention: using gcc or g++ for the case of macros won&#039;t make a difference here.</description>
		<content:encoded><![CDATA[<p>I forgot to mention: using gcc or g++ for the case of macros won&#8217;t make a difference here.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Arnaud Charlet</title>
		<link>http://www.adacore.com/2009/02/23/gem-59/comment-page-1/#comment-3381</link>
		<dc:creator>Arnaud Charlet</dc:creator>
		<pubDate>Tue, 24 Feb 2009 17:48:17 +0000</pubDate>
		<guid isPermaLink="false">http://www2.adacore.com/?p=2596#comment-3381</guid>
		<description>I see that we&#039;re now getting into advanced topics, probably good material for future gems :-)

function-like macros are a real challenge because they lack type information about parameters (and because they can include any arbitrary code).

Currently, the binding generator will generate pseudo Ada code for function-like macros that can be copy/pasted and transformed into inline Ada functions by adding manually the appropriate types, at least in the simple cases, which represents maybe 80% of the typical use of arg macros.

For example if you consider the following C macro:
#define func1(a,b) (a+b)

it will get &quot;translated&quot; into:
  --  arg-macro: function func1 (a, b)
  --    return a+b;</description>
		<content:encoded><![CDATA[<p>I see that we&#8217;re now getting into advanced topics, probably good material for future gems :-)</p>
<p>function-like macros are a real challenge because they lack type information about parameters (and because they can include any arbitrary code).</p>
<p>Currently, the binding generator will generate pseudo Ada code for function-like macros that can be copy/pasted and transformed into inline Ada functions by adding manually the appropriate types, at least in the simple cases, which represents maybe 80% of the typical use of arg macros.</p>
<p>For example if you consider the following C macro:<br />
#define func1(a,b) (a+b)</p>
<p>it will get &#8220;translated&#8221; into:<br />
  &#8212;  arg-macro: function func1 (a, b)<br />
  &#8212;    return a+b;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul Pearson</title>
		<link>http://www.adacore.com/2009/02/23/gem-59/comment-page-1/#comment-3380</link>
		<dc:creator>Paul Pearson</dc:creator>
		<pubDate>Tue, 24 Feb 2009 17:24:19 +0000</pubDate>
		<guid isPermaLink="false">http://www2.adacore.com/?p=2596#comment-3380</guid>
		<description>This could be very handy for linking with some scripting language libraries, such as lua.

How does -fdump-ada-spec handle function-like macros? Would g++ do it &quot;better&quot; than gcc?</description>
		<content:encoded><![CDATA[<p>This could be very handy for linking with some scripting language libraries, such as lua.</p>
<p>How does -fdump-ada-spec handle function-like macros? Would g++ do it &#8220;better&#8221; than gcc?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Arnaud Charlet</title>
		<link>http://www.adacore.com/2009/02/23/gem-59/comment-page-1/#comment-3378</link>
		<dc:creator>Arnaud Charlet</dc:creator>
		<pubDate>Tue, 24 Feb 2009 07:25:43 +0000</pubDate>
		<guid isPermaLink="false">http://www2.adacore.com/?p=2596#comment-3378</guid>
		<description>GNAT 6.2.1 provides this feature</description>
		<content:encoded><![CDATA[<p>GNAT 6.2.1 provides this feature</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: qunying</title>
		<link>http://www.adacore.com/2009/02/23/gem-59/comment-page-1/#comment-3374</link>
		<dc:creator>qunying</dc:creator>
		<pubDate>Mon, 23 Feb 2009 22:37:29 +0000</pubDate>
		<guid isPermaLink="false">http://www2.adacore.com/?p=2596#comment-3374</guid>
		<description>What version of gnat/gcc that starts to have this feature?</description>
		<content:encoded><![CDATA[<p>What version of gnat/gcc that starts to have this feature?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

