<div dir="ltr">Surely we&#39;d want to write it thus:?<div><br></div><div><div><div>#if defined(HAVE_SYS_UUID_H)</div><div># include &lt;sys/types.h&gt;</div><div># include &lt;sys/uuid.h&gt;</div><div>#elif defined(HAVE_UUID_UUID_H)</div>
<div># include &lt;uuid/uuid.h&gt;</div><div>#elif defined(HAVE_UUID_H)</div><div># include &lt;uuid.h&gt;</div><div>#else</div><div># error cannot find a uuid.h to include</div><div>#endif</div></div></div><div><br></div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jan 7, 2013 at 4:31 AM, Frank Shearar <span dir="ltr">&lt;<a href="mailto:frank.shearar@gmail.com" target="_blank">frank.shearar@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im"><br>
On 3 January 2013 00:35, David T. Lewis &lt;<a href="mailto:lewis@mail.msen.com">lewis@mail.msen.com</a>&gt; wrote:<br>
&gt;<br>
</div><div class="im">&gt; On Wed, Jan 02, 2013 at 07:22:42PM +0000, Frank Shearar wrote:<br>
&gt;&gt;<br>
&gt;&gt; I&#39;m setting up more CI jobs, this time to give FreeBSD some love. So I<br>
&gt;&gt; have a script that gets the bleeding edge Interpreter source, cd<br>
&gt;&gt; platform/unix; make. The results are here:<br>
&gt;&gt; <a href="http://squeakci.org/job/InterpreterVM-FreeBSD/13/console" target="_blank">http://squeakci.org/job/InterpreterVM-FreeBSD/13/console</a><br>
&gt;&gt;<br>
&gt;&gt; The punchline is that compilation fails thusly:<br>
&gt;&gt;<br>
&gt;&gt; In file included from<br>
&gt;&gt; /usr/home/frank/temp/jenkins/workspace/InterpreterVM-FreeBSD/target/Squeak-vm-unix-4.10.7-2646-unofficial-src/platforms/unix/plugins/UUIDPlugin/sqUnixUUID.c:9:<br>
&gt;&gt; /usr/local/include/uuid/uuid.h:44: error: conflicting types for &#39;uuid_t&#39;<br>
&gt;&gt; /usr/include/sys/uuid.h:74: error: previous declaration of &#39;uuid_t&#39; was here<br>
&gt;<br>
&gt; Frank,<br>
&gt;<br>
&gt; The error message above looks mighty suspicious to me. Where did that<br>
&gt; /usr/local/include/uuid/uuid.h come from? I have a hunch that you may<br>
&gt; have a locally installed libuuid package that is providing a header<br>
&gt; file that conflicts with a /usr/include/sys/uuid.h that came with your<br>
&gt; base FreeBSD distribution.<br>
<br>
</div>If I adjust sqUnixUUID.c in this fashion:<br>
<br>
<br>
#if defined(HAVE_SYS_UUID_H)<br>
# include &lt;sys/types.h&gt;<br>
# include &lt;sys/uuid.h&gt;<br>
#endif<br>
<br>
+ #if !(defined(HAVE_SYS_UUID_H)) &amp;&amp; defined(HAVE_UUID_UUID_H)<br>
- #if defined(HAVE_UUID_UUID_H)<br>
# include &lt;uuid/uuid.h&gt;<br>
#elif defined(HAVE_UUID_H)<br>
# include &lt;uuid.h&gt;<br>
#endif<br>
<br>
I can happily compile the UUID plugin! I think the issue arises for me<br>
because config finds BOTH sys/uuid.h AND uuid/uuid.h.<br>
<span class="HOEnZb"><font color="#888888"><br>
frank<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
&gt; I&#39;m pretty sure that libuuid is entitled to some sort of Guiness world record<br>
&gt; for greatest number of stupid preventable bugs for a single small system<br>
&gt; library. The proliferation of include/uuid/uuid.h versus include/sys/uuid.h<br>
&gt; mismatches is a big part of it, but read our very own Mantis tale of woe for<br>
&gt; further entertainment:<br>
&gt;<br>
&gt; <a href="http://bugs.squeak.org/view.php?id=7358" target="_blank">http://bugs.squeak.org/view.php?id=7358</a><br>
&gt;<br>
&gt; Dave<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;&gt; /usr/home/frank/temp/jenkins/workspace/InterpreterVM-FreeBSD/target/Squeak-vm-unix-4.10.7-2646-unofficial-src/platforms/unix/plugins/UUIDPlugin/sqUnixUUID.c:<br>
&gt;&gt; In function &#39;MakeUUID&#39;:<br>
&gt;&gt; /usr/home/frank/temp/jenkins/workspace/InterpreterVM-FreeBSD/target/Squeak-vm-unix-4.10.7-2646-unofficial-src/platforms/unix/plugins/UUIDPlugin/sqUnixUUID.c:29:<br>
&gt;&gt; warning: passing argument 1 of &#39;uuidgen&#39; from incompatible pointer<br>
&gt;&gt;<br>
&gt;&gt; The relevant source is here:<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; int MakeUUID(char *location)<br>
&gt;&gt; {<br>
&gt;&gt; #if defined(HAVE_UUID_CREATE) &amp;&amp; !defined(HAVE_UUIDGEN) &amp;&amp;<br>
&gt;&gt; !defined(HAVE_UUID_GENERATE)<br>
&gt;&gt;   size_t  len= 16;      /* 128 bits */<br>
&gt;&gt;   uuid_t *uuid;<br>
&gt;&gt;   uuid_create(&amp;uuid);<br>
&gt;&gt;   uuid_make(uuid, UUID_MAKE_V1);<br>
&gt;&gt;   uuid_export(uuid, UUID_FMT_BIN, (void **)&amp;location, &amp;len);<br>
&gt;&gt;   uuid_destroy(uuid);<br>
&gt;&gt; #else<br>
&gt;&gt;   uuid_t uuid;<br>
&gt;&gt; #  if defined(HAVE_UUIDGEN)<br>
&gt;&gt;   uuidgen(&amp;uuid, 1);   // &lt;-- this is line 29, the offender<br>
&gt;&gt; #  elif defined(HAVE_UUID_GENERATE)<br>
&gt;&gt;   uuid_generate(uuid);<br>
&gt;&gt; #  endif<br>
&gt;&gt;   memcpy((void *)location, (void *)&amp;uuid, sizeof(uuid));<br>
&gt;&gt; #endif<br>
&gt;&gt;   return 1;<br>
&gt;&gt; }<br>
&gt;&gt;<br>
&gt;&gt; Any ideas? I&#39;m happy to do legwork, but Bozhe moi! This I know from nothing!<br>
&gt;&gt;<br>
&gt;&gt; frank<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>best,<div>Eliot</div>
</div>