From: drh Date: Wed, 12 Aug 2009 11:45:40 +0000 (+0000) Subject: Make sure the large-file support macros occur first in sqliteInt.h. X-Git-Tag: cvs-to-fossil-cutover X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2210dcc60d92d9920cd1ee6f085f820b2bf0f8e0;p=thirdparty%2Fsqlite.git Make sure the large-file support macros occur first in sqliteInt.h. Fix for CVSTrac ticket #4022. FossilOrigin-Name: b0848925babde5241aefe0a117ebb10299c94a15 --- diff --git a/manifest b/manifest index dd8ea839eb..e0e49703b9 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,8 @@ -C Instead\sof\sadding\sSQLITE_API\smacros\ssqlite3.h\swhile\screating\ssqlite3.c,\sadd\sthem\sas\spart\sof\sgenerating\sthe\ssqlite3.h\starget,\swhile\scopying\sfrom\ssqlite.h.in\sto\ssqlite3.h.\sThis\sfixes\sa\sbuild\sproblem\sthat\swas\scausing\smultiple\sSQLITE_API\smacros\sto\sbe\sadded\sto\sa\ssingle\sline\sof\ssqlite3.h,\sand\sthe\sproblem\scited\sby\s#4016.\s(CVS\s6971) -D 2009-08-11T05:50:37 +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA1 + +C Make\ssure\sthe\slarge-file\ssupport\smacros\soccur\sfirst\sin\ssqliteInt.h.\nFix\sfor\sCVSTrac\sticket\s#4022. +D 2009-08-12T11:45:41 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0 F Makefile.in c606c9b502dfde3b9c3b2d23ed49f3737829693b F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654 @@ -163,7 +166,7 @@ F src/select.c 67b0778c9585905c8aa75aaa469e76ef3c1d315a F src/shell.c db2643650b9268df89a4bedca3f1c6d9e786f1bb F src/sqlite.h.in eb42257503a48f6f12ff0b23a81067ba9b5ac1eb F src/sqlite3ext.h 1db7d63ab5de4b3e6b83dd03d1a4e64fef6d2a17 -F src/sqliteInt.h 1840be421126be4e0027cc5b144bc82659ff781f +F src/sqliteInt.h 6337542c0eb0e6521991b29f59c8bcbdfda222e7 F src/sqliteLimit.h ffe93f5a0c4e7bd13e70cd7bf84cfb5c3465f45d F src/status.c 237b193efae0cf6ac3f0817a208de6c6c6ef6d76 F src/table.c cc86ad3d6ad54df7c63a3e807b5783c90411a08d @@ -742,7 +745,14 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e F tool/vdbe-compress.tcl 672f81d693a03f80f5ae60bfefacd8a349e76746 -P 8e1e0ba292150f8968e5295e8ba9cd7360b6a64b -R 308a6bcce7db99c384df7b8b7a17f2b7 -U danielk1977 -Z 90e0bfaf3a9074b7bda5def71f339420 +P 7f4810747b0864981f27edbd504bfab2efea1e3c +R 680830094bf2c6c0483804abaedb784f +U drh +Z 0e78fd18dba7cf28c119ae9acf373d8c +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1.4.1 (Darwin) + +iD8DBQFKgqtqoxKgR168RlERAk55AJ4qz1L4Doc0PwV2LXMDYvvmWnroBwCfeyVW +Gogu2M2hJv/I58I80flxUqA= +=Ha82 +-----END PGP SIGNATURE----- diff --git a/manifest.uuid b/manifest.uuid index e06b513676..5ede6547ce 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -7f4810747b0864981f27edbd504bfab2efea1e3c \ No newline at end of file +b0848925babde5241aefe0a117ebb10299c94a15 \ No newline at end of file diff --git a/src/sqliteInt.h b/src/sqliteInt.h index 19af9ce18d..8a3df484e0 100644 --- a/src/sqliteInt.h +++ b/src/sqliteInt.h @@ -16,6 +16,33 @@ #ifndef _SQLITEINT_H_ #define _SQLITEINT_H_ +/* +** These #defines should enable >2GB file support on POSIX if the +** underlying operating system supports it. If the OS lacks +** large file support, or if the OS is windows, these should be no-ops. +** +** Ticket #2739: The _LARGEFILE_SOURCE macro must appear before any +** system #includes. Hence, this block of code must be the very first +** code in all source files. +** +** Large file support can be disabled using the -DSQLITE_DISABLE_LFS switch +** on the compiler command line. This is necessary if you are compiling +** on a recent machine (ex: Red Hat 7.2) but you want your code to work +** on an older machine (ex: Red Hat 6.0). If you compile on Red Hat 7.2 +** without this option, LFS is enable. But LFS does not exist in the kernel +** in Red Hat 6.0, so the code won't work. Hence, for maximum binary +** portability you should omit LFS. +** +** Similar is true for Mac OS X. LFS is only supported on Mac OS X 9 and later. +*/ +#ifndef SQLITE_DISABLE_LFS +# define _LARGE_FILE 1 +# ifndef _FILE_OFFSET_BITS +# define _FILE_OFFSET_BITS 64 +# endif +# define _LARGEFILE_SOURCE 1 +#endif + /* ** Include the configuration header output by 'configure' if we're using the ** autoconf-based build @@ -82,33 +109,6 @@ # define SQLITE_PTR_TO_INT(X) ((int)(((char*)X)-(char*)0)) #endif -/* -** These #defines should enable >2GB file support on POSIX if the -** underlying operating system supports it. If the OS lacks -** large file support, or if the OS is windows, these should be no-ops. -** -** Ticket #2739: The _LARGEFILE_SOURCE macro must appear before any -** system #includes. Hence, this block of code must be the very first -** code in all source files. -** -** Large file support can be disabled using the -DSQLITE_DISABLE_LFS switch -** on the compiler command line. This is necessary if you are compiling -** on a recent machine (ex: Red Hat 7.2) but you want your code to work -** on an older machine (ex: Red Hat 6.0). If you compile on Red Hat 7.2 -** without this option, LFS is enable. But LFS does not exist in the kernel -** in Red Hat 6.0, so the code won't work. Hence, for maximum binary -** portability you should omit LFS. -** -** Similar is true for Mac OS X. LFS is only supported on Mac OS X 9 and later. -*/ -#ifndef SQLITE_DISABLE_LFS -# define _LARGE_FILE 1 -# ifndef _FILE_OFFSET_BITS -# define _FILE_OFFSET_BITS 64 -# endif -# define _LARGEFILE_SOURCE 1 -#endif - /* ** The SQLITE_THREADSAFE macro must be defined as either 0 or 1.