From: drh Date: Mon, 1 Oct 2007 17:47:00 +0000 (+0000) Subject: Additional #ifdefing around _XOPEN_SOURCE. Ticket #2681. (CVS 4452) X-Git-Tag: version-3.6.10~1725 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e5e7a901bd78a9fec09c04dd88730873afd4fd8b;p=thirdparty%2Fsqlite.git Additional #ifdefing around _XOPEN_SOURCE. Ticket #2681. (CVS 4452) FossilOrigin-Name: eb5d78451ee2a5d8480537530f30fbb305bf7632 --- diff --git a/manifest b/manifest index a82162b239..f6ee0cd8c0 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Document\sthat\sEND\sTRANSACTION\sis\san\salias\sfor\sCOMMIT.\s\sTicket\s#2656\s(CVS\s4451) -D 2007-10-01T17:45:40 +C Additional\s#ifdefing\saround\s_XOPEN_SOURCE.\s\sTicket\s#2681.\s(CVS\s4452) +D 2007-10-01T17:47:00 F Makefile.in cbfb898945536a8f9ea8b897e1586dd1fdbcc5db F Makefile.linux-gcc 65241babba6faf1152bf86574477baab19190499 F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028 @@ -132,7 +132,7 @@ F src/server.c 087b92a39d883e3fa113cae259d64e4c7438bc96 F src/shell.c 82089379833e361ba8a2ae65316a2173785300c0 F src/sqlite.h.in 60d1a884f49304787b07864ceba31e6df93a5a7c F src/sqlite3ext.h a93f59cdee3638dc0c9c086f80df743a4e68c3cb -F src/sqliteInt.h cb503be6d432493c877674e129369d928441bc0a +F src/sqliteInt.h 8fb50cf69b235dfe7f3b604d4d219a9726b8478c F src/sqliteLimit.h 1bcbbdfa856f8b71b561abb31edb864b0eca1d12 F src/table.c 1aeb9eab57b4235db86fe15a35dec76fb445a9c4 F src/tclsqlite.c 9659ec914abfdb35e184eee908d07eba11a39018 @@ -580,7 +580,7 @@ F www/tclsqlite.tcl 8be95ee6dba05eabcd27a9d91331c803f2ce2130 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0 F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b F www/whentouse.tcl fc46eae081251c3c181bd79c5faef8195d7991a5 -P 0bbf654b6745058a705ef5c320bdd5fb06735271 -R dbb20b7521eafe586ad12791eba4eb3d +P ebe3e6913c35bebb0e78dac995527d5da97a9377 +R cfc075825147a4ccdcc8d892e7e61dcc U drh -Z 4ce0ec44aa7cb02f4e0a539e35574c34 +Z fd115abb078ffce00ef35ed41bd4c589 diff --git a/manifest.uuid b/manifest.uuid index 5037cf2413..bd5937a412 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -ebe3e6913c35bebb0e78dac995527d5da97a9377 \ No newline at end of file +eb5d78451ee2a5d8480537530f30fbb305bf7632 \ No newline at end of file diff --git a/src/sqliteInt.h b/src/sqliteInt.h index 82e3470dc2..3a262fc103 100644 --- a/src/sqliteInt.h +++ b/src/sqliteInt.h @@ -11,7 +11,7 @@ ************************************************************************* ** Internal interface definitions for SQLite. ** -** @(#) $Id: sqliteInt.h,v 1.611 2007/10/01 14:30:15 drh Exp $ +** @(#) $Id: sqliteInt.h,v 1.612 2007/10/01 17:47:00 drh Exp $ */ #ifndef _SQLITEINT_H_ #define _SQLITEINT_H_ @@ -59,13 +59,32 @@ extern int sqlite3MAX_LIKE_PATTERN_LENGTH; #endif + +/* +** The SQLITE_THREADSAFE macro must be defined as either 0 or 1. +** Older versions of SQLite used an optional THREADSAFE macro. +** We support that for legacy +*/ +#if !defined(SQLITE_THREADSAFE) +#if defined(THREADSAFE) +# define SQLITE_THREADSAFE THREADSAFE +#else +# define SQLITE_THREADSAFE 1 +#endif +#endif + /* ** We need to define _XOPEN_SOURCE as follows in order to enable ** recursive mutexes on most unix systems. But Mac OS X is different. ** The _XOPEN_SOURCE define causes problems for Mac OS X we are told, ** so it is omitted there. See ticket #2673. +** +** Later we learn that _XOPEN_SOURCE is poorly or incorrectly +** implemented on some systems. So we avoid defining it at all +** if it is already defined or if it is unneeded because we are +** not doing a threadsafe build. Ticket #2681. */ -#ifndef __MACOS__ +#if !defined(_XOPEN_SOURCE) && !defined(__MACOS__) && SQLITE_THREADSAFE # define _XOPEN_SOURCE 500 /* Needed to enable pthread recursive mutexes */ #endif @@ -84,19 +103,6 @@ # define NDEBUG 1 #endif -/* -** The SQLITE_THREADSAFE macro must be defined as either 0 or 1. -** Older versions of SQLite used an optional THREADSAFE macro. -** We support that for legacy -*/ -#if !defined(SQLITE_THREADSAFE) -#if defined(THREADSAFE) -# define SQLITE_THREADSAFE THREADSAFE -#else -# define SQLITE_THREADSAFE 1 -#endif -#endif - /* ** These #defines should enable >2GB file support on Posix if the ** underlying operating system supports it. If the OS lacks