/ Check-in [211411d0]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add #ifdef magic for HAVE_GETHOSTUUID so that the build will hopefully now work on more verions of MacOS with SQLITE_ENABLE_LOCKING_STYLE turned on.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 211411d02c0729c9af0e3cc7e4910db2e7e0d08e
User & Date: drh 2015-04-13 23:05:28
Context
2015-04-14
15:14
Update API documentation to identify many functions as methods on objects. No changes to code. check-in: b549cbce user: drh tags: trunk
2015-04-13
23:11
Merge all recent trunk enhances into the apple-osx branch. check-in: e709d3b4 user: drh tags: apple-osx
23:05
Add #ifdef magic for HAVE_GETHOSTUUID so that the build will hopefully now work on more verions of MacOS with SQLITE_ENABLE_LOCKING_STYLE turned on. check-in: 211411d0 user: drh tags: trunk
22:26
On a DETACH statement, keep all schemas intact except fo the one that is being detached, and thus avoid unnecessary schema reparsing. check-in: 661db19b user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/os_unix.c.

    86     86   #endif
    87     87   
    88     88   #if SQLITE_ENABLE_LOCKING_STYLE
    89     89   # include <sys/ioctl.h>
    90     90   # include <sys/file.h>
    91     91   # include <sys/param.h>
    92     92   #endif /* SQLITE_ENABLE_LOCKING_STYLE */
           93  +
           94  +#if defined(__APPLE__) && ((__MAC_OS_X_VERSION_MIN_REQUIRED > 1050) || \
           95  +                           (__IPHONE_OS_VERSION_MIN_REQUIRED > 2000))
           96  +#  if (!defined(TARGET_OS_EMBEDDED) || (TARGET_OS_EMBEDDED==0)) \
           97  +       && (!defined(TARGET_IPHONE_SIMULATOR) || (TARGET_IPHONE_SIMULATOR==0))
           98  +#    define HAVE_GETHOSTUUID 1
           99  +#  else
          100  +#    warning "gethostuuid() is disabled."
          101  +#  endif
          102  +#endif
          103  +
    93    104   
    94    105   #if OS_VXWORKS
    95    106   # include <sys/ioctl.h>
    96    107   # include <semaphore.h>
    97    108   # include <limits.h>
    98    109   #endif /* OS_VXWORKS */
    99    110   
................................................................................
  6598   6609   #ifdef SQLITE_TEST
  6599   6610   /* simulate multiple hosts by creating unique hostid file paths */
  6600   6611   int sqlite3_hostid_num = 0;
  6601   6612   #endif
  6602   6613   
  6603   6614   #define PROXY_HOSTIDLEN    16  /* conch file host id length */
  6604   6615   
         6616  +#ifdef HAVE_GETHOSTUUID
  6605   6617   /* Not always defined in the headers as it ought to be */
  6606   6618   extern int gethostuuid(uuid_t id, const struct timespec *wait);
         6619  +#endif
  6607   6620   
  6608   6621   /* get the host ID via gethostuuid(), pHostID must point to PROXY_HOSTIDLEN 
  6609   6622   ** bytes of writable memory.
  6610   6623   */
  6611   6624   static int proxyGetHostID(unsigned char *pHostID, int *pError){
  6612   6625     assert(PROXY_HOSTIDLEN == sizeof(uuid_t));
  6613   6626     memset(pHostID, 0, PROXY_HOSTIDLEN);
  6614         -# if defined(__APPLE__) && ((__MAC_OS_X_VERSION_MIN_REQUIRED > 1050) || \
  6615         -                            (__IPHONE_OS_VERSION_MIN_REQUIRED > 2000))
         6627  +#ifdef HAVE_GETHOSTUUID
  6616   6628     {
  6617   6629       struct timespec timeout = {1, 0}; /* 1 sec timeout */
  6618   6630       if( gethostuuid(pHostID, &timeout) ){
  6619   6631         int err = errno;
  6620   6632         if( pError ){
  6621   6633           *pError = err;
  6622   6634         }