On 20 July 2011 17:31, Levente Uzonyi <leves@elte.hu> wrote:
On Wed, 20 Jul 2011, Igor Stasenko wrote:
I changed the MakeUUID in sqUnixUUID.c to look like following:
This change is useless IMHO. Instead of stopping the compilation, either return 0 from the function, so the primitive will fail, or fix the included header files for Darwin, which has uuid_generate (http://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPag... ). But the best solution is using the Mac OS platform files instead of the Unix ones for Mac OS.
Right, that's why i pointed Esteban to use mac-specific functions. Well, the problem was initially reported for unix builds. And why stopping compilation useless? It indicating the configuration error, while if we do as you proposing, then prim will always fail and UUID will work.. but then its a question, why we need uuid plugin at all, if it's not using any function for generating uuids? I prefer to have compilation error, than useless and malfunctioning plugin which does nothing.
Levente
int MakeUUID(char *location) { Â uuid_t uuid;
#if defined(HAVE_UUIDGEN) Â uuidgen(&uuid, 1); #elif defined(HAVE_UUID_GENERATE) Â uuid_generate(uuid); #else #error "No uuid function provided" #endif
 memcpy((void *)location, (void *)&uuid, sizeof(uuid));  return 1; }
and during compiling cocoa vms it fails with error. And before change the code was looking like following:
int MakeUUID(char *location) { Â uuid_t uuid;
#if defined(HAVE_UUIDGEN) Â uuidgen(&uuid, 1); #elif defined(HAVE_UUID_GENERATE) Â uuid_generate(uuid); #endif
 memcpy((void *)location, (void *)&uuid, sizeof(uuid));  return 1; }
which means that if none HAVE_UUIDGEN or HAVE_UUID_GENERATE is defined, then there is nothing got called and memcpy then returns a random values on stack, copied from uuid to locaiton.
And first version of that file just contains :
int MakeUUID(char *location) { Â uuid_t uuid; Â uuid_generate(uuid); Â memcpy((void *)location, (void *)&uuid, sizeof(uuid)); Â return 1; }
and then changed to:
#if defined(__NetBSD__)  uuidgen(&uuid, 1); #else  uuid_generate(uuid); #endif
and then changed to:
#if defined(HAVE_UUIDGEN) Â uuidgen(&uuid, 1); #elif defined(HAVE_UUID_GENERATE) Â uuid_generate(uuid); #endif
Blame: Merge Levente's linux UUIDPlugin fix. Fix tickerSleepCycle decl in heartbeat. Restore -O2 optimization for the interpreter.
Author: eliot Date: Â 5 months ago Commit: 757297f62c32eaf2af7f26ce66aa6499df776749
-- Best regards, Igor Stasenko AKA sig.
-- Best regards, Igor Stasenko AKA sig.