<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>allegro compile compile problems for djgpp</title>
		<link>http://www.allegro.cc/forums/view/590637</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Wed, 21 Mar 2007 02:55:56 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>i hate rehashing problems, but being as i didn&#39;t get an answer...</p><p>over two weeks ago i had problems compiling allegro for djgpp. it compiled every thing up to the dfile.c and gave me this error:</p><p>gcc -DALLEGRO_SRC -DALLEGRO_LIB_BUILD -Wall -Wno-unused -mcpu=i586 -O2 -funroll-loops -ffast-math -fomit-frame-pointer -I. -I./include -o obj/djgpp/alleg/dfile.o -c src/dos/dfile.c<br />src/dos/dfile.c: In function `al_ffblk_get_size&#39;:<br />src/dos/dfile.c:340: parse error before `struct&#39;<br />src/dos/dfile.c:342: `ff_data&#39; undeclared (first use in this function)<br />src/dos/dfile.c:342: (Each undeclared identifier is reported only once<br />src/dos/dfile.c:342: for each function it appears in.)<br />src/dos/dfile.c:343: warning: control reaches end of non-void function<br />make.exe: *** [obj/djgpp/alleg/dfile.o] Error 1</p><p>i deleted the allegro directory and unziped it again and ran make with the -k option and found out that every thing else compiles properly except the dfile.c</p><p>i attempted to understand what was going on with the file, but the only thing that stood out to me was that the last 5 or 6 lines of code didn&#39;t look right:</p><div class="source-code snippet"><div class="inner"><pre>uint64_t <a href="http://www.allegro.cc/manual/al_ffblk_get_size" target="_blank"><span class="a">al_ffblk_get_size</span></a><span class="k2">(</span><span class="k1">struct</span> <a href="http://www.allegro.cc/manual/al_ffblk" target="_blank"><span class="a">al_ffblk</span></a> <span class="k3">*</span>info<span class="k2">)</span>
<span class="k2">{</span>
   <a href="http://www.allegro.cc/manual/ASSERT" target="_blank"><span class="a">ASSERT</span></a><span class="k2">(</span>info<span class="k2">)</span><span class="k2">;</span>
   <span class="k1">struct</span> FF_DATA <span class="k3">*</span>ff_data <span class="k3">=</span> <span class="k2">(</span><span class="k1">struct</span> FF_DATA <span class="k3">*</span><span class="k2">)</span> info-&gt;ff_data<span class="k2">;</span>

   <span class="k1">return</span> ff_data-&gt;data.ff_fsize<span class="k2">;</span>
<span class="k2">}</span>
</pre></div></div><p>

{accedental prepost--edit}</p><p>the more i looked at it the more it seemed to me that the first two lines of code<br />were backwards. i flip-floped the two lines so that they looked like this:</p><div class="source-code snippet"><div class="inner"><pre>uint64_t <a href="http://www.allegro.cc/manual/al_ffblk_get_size" target="_blank"><span class="a">al_ffblk_get_size</span></a><span class="k2">(</span><span class="k1">struct</span> <a href="http://www.allegro.cc/manual/al_ffblk" target="_blank"><span class="a">al_ffblk</span></a> <span class="k3">*</span>info<span class="k2">)</span>
<span class="k2">{</span>
   <span class="k1">struct</span> FF_DATA <span class="k3">*</span>ff_data <span class="k3">=</span> <span class="k2">(</span><span class="k1">struct</span> FF_DATA <span class="k3">*</span><span class="k2">)</span> info-&gt;ff_data<span class="k2">;</span>
   <a href="http://www.allegro.cc/manual/ASSERT" target="_blank"><span class="a">ASSERT</span></a><span class="k2">(</span>info<span class="k2">)</span><span class="k2">;</span>

   <span class="k1">return</span> ff_data-&gt;data.ff_fsize<span class="k2">;</span>
<span class="k2">}</span>
</pre></div></div><p>

when i compiled it again it processed correctly. my question is will the new code work the way it is intended to?</p><p>EDIT:</p><p>ALL LINES OF CODE HAVE BEEN TAKEN FROM LINES 337-343 OF DFILE.C( just to avoid confusion)
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Alysher)</author>
		<pubDate>Wed, 21 Mar 2007 01:57:14 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
when i compiled it again it processed correctly. my question is will the new code work the way it is intended to?
</p></div></div><p>
No, it won&#39;t. But ASSERT() is just a debug tool, so as long as you aren&#39;t throwing NULL pointers around, it will be fine. It really should be:</p><div class="source-code snippet"><div class="inner"><pre>uint64_t <a href="http://www.allegro.cc/manual/al_ffblk_get_size" target="_blank"><span class="a">al_ffblk_get_size</span></a><span class="k2">(</span><span class="k1">struct</span> <a href="http://www.allegro.cc/manual/al_ffblk" target="_blank"><span class="a">al_ffblk</span></a> <span class="k3">*</span>info<span class="k2">)</span>
<span class="k2">{</span>
   <span class="k1">struct</span> FF_DATA <span class="k3">*</span>ff_data<span class="k2">;</span>
   <a href="http://www.allegro.cc/manual/ASSERT" target="_blank"><span class="a">ASSERT</span></a><span class="k2">(</span>info<span class="k2">)</span><span class="k2">;</span>
   ff_data <span class="k3">=</span> <span class="k2">(</span><span class="k1">struct</span> FF_DATA <span class="k3">*</span><span class="k2">)</span> info-&gt;ff_data<span class="k2">;</span>
   <span class="k1">return</span> ff_data-&gt;data.ff_fsize<span class="k2">;</span>
<span class="k2">}</span>
</pre></div></div><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Matthew Leverton)</author>
		<pubDate>Wed, 21 Mar 2007 02:36:37 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>so if i replace the code you wrote with what was written then the compile will run properly and the code will work properly. is it possible to update dfile.c in the current stable source so that nobody else has the same problem as i did?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Alysher)</author>
		<pubDate>Wed, 21 Mar 2007 02:41:03 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Yes, it will work as intended. And yes, the source code in SVN has already been updated a while ago. Allegro just doesn&#39;t get many releases.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Matthew Leverton)</author>
		<pubDate>Wed, 21 Mar 2007 02:46:04 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>FINALLY!!! thank you for your help and your input.;D;D;D;D
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Alysher)</author>
		<pubDate>Wed, 21 Mar 2007 02:55:56 +0000</pubDate>
	</item>
</rss>
