<div dir="ltr">Surely we'd want to write it thus:?<div><br></div><div><div><div>#if defined(HAVE_SYS_UUID_H)</div><div># include <sys/types.h></div><div># include <sys/uuid.h></div><div>#elif defined(HAVE_UUID_UUID_H)</div>
<div># include <uuid/uuid.h></div><div>#elif defined(HAVE_UUID_H)</div><div># include <uuid.h></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"><<a href="mailto:frank.shearar@gmail.com" target="_blank">frank.shearar@gmail.com</a>></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 <<a href="mailto:lewis@mail.msen.com">lewis@mail.msen.com</a>> wrote:<br>
><br>
</div><div class="im">> On Wed, Jan 02, 2013 at 07:22:42PM +0000, Frank Shearar wrote:<br>
>><br>
>> I'm setting up more CI jobs, this time to give FreeBSD some love. So I<br>
>> have a script that gets the bleeding edge Interpreter source, cd<br>
>> platform/unix; make. The results are here:<br>
>> <a href="http://squeakci.org/job/InterpreterVM-FreeBSD/13/console" target="_blank">http://squeakci.org/job/InterpreterVM-FreeBSD/13/console</a><br>
>><br>
>> The punchline is that compilation fails thusly:<br>
>><br>
>> In file included from<br>
>> /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>
>> /usr/local/include/uuid/uuid.h:44: error: conflicting types for 'uuid_t'<br>
>> /usr/include/sys/uuid.h:74: error: previous declaration of 'uuid_t' was here<br>
><br>
> Frank,<br>
><br>
> The error message above looks mighty suspicious to me. Where did that<br>
> /usr/local/include/uuid/uuid.h come from? I have a hunch that you may<br>
> have a locally installed libuuid package that is providing a header<br>
> file that conflicts with a /usr/include/sys/uuid.h that came with your<br>
> 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 <sys/types.h><br>
# include <sys/uuid.h><br>
#endif<br>
<br>
+ #if !(defined(HAVE_SYS_UUID_H)) && defined(HAVE_UUID_UUID_H)<br>
- #if defined(HAVE_UUID_UUID_H)<br>
# include <uuid/uuid.h><br>
#elif defined(HAVE_UUID_H)<br>
# include <uuid.h><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>
> I'm pretty sure that libuuid is entitled to some sort of Guiness world record<br>
> for greatest number of stupid preventable bugs for a single small system<br>
> library. The proliferation of include/uuid/uuid.h versus include/sys/uuid.h<br>
> mismatches is a big part of it, but read our very own Mantis tale of woe for<br>
> further entertainment:<br>
><br>
> <a href="http://bugs.squeak.org/view.php?id=7358" target="_blank">http://bugs.squeak.org/view.php?id=7358</a><br>
><br>
> Dave<br>
><br>
><br>
><br>
><br>
>> /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>
>> In function 'MakeUUID':<br>
>> /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>
>> warning: passing argument 1 of 'uuidgen' from incompatible pointer<br>
>><br>
>> The relevant source is here:<br>
>><br>
>><br>
>> int MakeUUID(char *location)<br>
>> {<br>
>> #if defined(HAVE_UUID_CREATE) && !defined(HAVE_UUIDGEN) &&<br>
>> !defined(HAVE_UUID_GENERATE)<br>
>> size_t len= 16; /* 128 bits */<br>
>> uuid_t *uuid;<br>
>> uuid_create(&uuid);<br>
>> uuid_make(uuid, UUID_MAKE_V1);<br>
>> uuid_export(uuid, UUID_FMT_BIN, (void **)&location, &len);<br>
>> uuid_destroy(uuid);<br>
>> #else<br>
>> uuid_t uuid;<br>
>> # if defined(HAVE_UUIDGEN)<br>
>> uuidgen(&uuid, 1); // <-- this is line 29, the offender<br>
>> # elif defined(HAVE_UUID_GENERATE)<br>
>> uuid_generate(uuid);<br>
>> # endif<br>
>> memcpy((void *)location, (void *)&uuid, sizeof(uuid));<br>
>> #endif<br>
>> return 1;<br>
>> }<br>
>><br>
>> Any ideas? I'm happy to do legwork, but Bozhe moi! This I know from nothing!<br>
>><br>
>> frank<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>best,<div>Eliot</div>
</div>