diff options
author | drh <drh@noemail.net> | 2015-04-15 14:14:38 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2015-04-15 14:14:38 +0000 |
commit | ff363ee1217d79e8988a16ef0d72e5ee1729dc48 (patch) | |
tree | ad4bf050eb315f2742224500d564bb8918458bf5 /src/os_unix.c | |
parent | df3c171881b4ee77003b9d7e287220c22dbc97a2 (diff) | |
parent | 0d01ec8de83b4e0d7523d67c5f92a44f0ba79b8e (diff) | |
download | sqlite-ff363ee1217d79e8988a16ef0d72e5ee1729dc48.tar.gz sqlite-ff363ee1217d79e8988a16ef0d72e5ee1729dc48.zip |
Merge all recent trunk fixes and enhancements into the sessions branch.
FossilOrigin-Name: e65e65f9bc9b4bf5c9dd6e3a77a0d5f03c40e006
Diffstat (limited to 'src/os_unix.c')
-rw-r--r-- | src/os_unix.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/os_unix.c b/src/os_unix.c index 1d867d7cd..188c02533 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -91,6 +91,17 @@ # include <sys/param.h> #endif /* SQLITE_ENABLE_LOCKING_STYLE */ +#if defined(__APPLE__) && ((__MAC_OS_X_VERSION_MIN_REQUIRED > 1050) || \ + (__IPHONE_OS_VERSION_MIN_REQUIRED > 2000)) +# if (!defined(TARGET_OS_EMBEDDED) || (TARGET_OS_EMBEDDED==0)) \ + && (!defined(TARGET_IPHONE_SIMULATOR) || (TARGET_IPHONE_SIMULATOR==0)) +# define HAVE_GETHOSTUUID 1 +# else +# warning "gethostuuid() is disabled." +# endif +#endif + + #if OS_VXWORKS # include <sys/ioctl.h> # include <semaphore.h> @@ -6602,8 +6613,10 @@ int sqlite3_hostid_num = 0; #define PROXY_HOSTIDLEN 16 /* conch file host id length */ +#ifdef HAVE_GETHOSTUUID /* Not always defined in the headers as it ought to be */ extern int gethostuuid(uuid_t id, const struct timespec *wait); +#endif /* get the host ID via gethostuuid(), pHostID must point to PROXY_HOSTIDLEN ** bytes of writable memory. @@ -6611,8 +6624,7 @@ extern int gethostuuid(uuid_t id, const struct timespec *wait); static int proxyGetHostID(unsigned char *pHostID, int *pError){ assert(PROXY_HOSTIDLEN == sizeof(uuid_t)); memset(pHostID, 0, PROXY_HOSTIDLEN); -# if defined(__APPLE__) && ((__MAC_OS_X_VERSION_MIN_REQUIRED > 1050) || \ - (__IPHONE_OS_VERSION_MIN_REQUIRED > 2000)) +#ifdef HAVE_GETHOSTUUID { struct timespec timeout = {1, 0}; /* 1 sec timeout */ if( gethostuuid(pHostID, &timeout) ){ |