/ Check-in [36465aeb]
Login

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

Overview
Comment:Make sure the _LARGEFILE_SOURCE macro occurs before any system includes. Ticket #2739. (CVS 4508)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 36465aeb1f8f92d336faf16c25608c9a8a6585d3
User & Date: drh 2007-10-23 15:51:27
Context
2007-10-23
15:59
Add comments to the code warning that _XOPEN_SOURCE might need to be defined manually if using USE_PREAD or USE_PREAD64. (CVS 4509) check-in: d7ed7cd0 user: drh tags: trunk
15:51
Make sure the _LARGEFILE_SOURCE macro occurs before any system includes. Ticket #2739. (CVS 4508) check-in: 36465aeb user: drh tags: trunk
15:39
Floating point and 64-bit integer constants store in the virtual machine opcodes in binary, not as text. Performance improvement. Ticket #2733. (CVS 4507) check-in: 7e30fd6a user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/sqliteInt.h.

     7      7   **    May you do good and not evil.
     8      8   **    May you find forgiveness for yourself and forgive others.
     9      9   **    May you share freely, never taking more than you give.
    10     10   **
    11     11   *************************************************************************
    12     12   ** Internal interface definitions for SQLite.
    13     13   **
    14         -** @(#) $Id: sqliteInt.h,v 1.615 2007/10/23 15:39:45 drh Exp $
           14  +** @(#) $Id: sqliteInt.h,v 1.616 2007/10/23 15:51:27 drh Exp $
    15     15   */
    16     16   #ifndef _SQLITEINT_H_
    17     17   #define _SQLITEINT_H_
           18  +
           19  +/*
           20  +** These #defines should enable >2GB file support on Posix if the
           21  +** underlying operating system supports it.  If the OS lacks
           22  +** large file support, or if the OS is windows, these should be no-ops.
           23  +**
           24  +** Ticket #2739:  The _LARGEFILE_SOURCE macro must appear before any
           25  +** system #includes.  Hence, this block of code must be the very first
           26  +** code in all source files.
           27  +**
           28  +** Large file support can be disabled using the -DSQLITE_DISABLE_LFS switch
           29  +** on the compiler command line.  This is necessary if you are compiling
           30  +** on a recent machine (ex: RedHat 7.2) but you want your code to work
           31  +** on an older machine (ex: RedHat 6.0).  If you compile on RedHat 7.2
           32  +** without this option, LFS is enable.  But LFS does not exist in the kernel
           33  +** in RedHat 6.0, so the code won't work.  Hence, for maximum binary
           34  +** portability you should omit LFS.
           35  +**
           36  +** Similar is true for MacOS.  LFS is only supported on MacOS 9 and later.
           37  +*/
           38  +#ifndef SQLITE_DISABLE_LFS
           39  +# define _LARGE_FILE       1
           40  +# ifndef _FILE_OFFSET_BITS
           41  +#   define _FILE_OFFSET_BITS 64
           42  +# endif
           43  +# define _LARGEFILE_SOURCE 1
           44  +#endif
           45  +
           46  +
    18     47   #include "sqliteLimit.h"
    19     48   
    20     49   /*
    21     50   ** For testing purposes, the various size limit constants are really
    22     51   ** variables that we can modify in the testfixture.
    23     52   */
    24     53   #ifdef SQLITE_TEST
................................................................................
    99    128   ** option is set.  Thus NDEBUG becomes an opt-in rather than an opt-out
   100    129   ** feature.
   101    130   */
   102    131   #if !defined(NDEBUG) && !defined(SQLITE_DEBUG) 
   103    132   # define NDEBUG 1
   104    133   #endif
   105    134   
   106         -/*
   107         -** These #defines should enable >2GB file support on Posix if the
   108         -** underlying operating system supports it.  If the OS lacks
   109         -** large file support, or if the OS is windows, these should be no-ops.
   110         -**
   111         -** Large file support can be disabled using the -DSQLITE_DISABLE_LFS switch
   112         -** on the compiler command line.  This is necessary if you are compiling
   113         -** on a recent machine (ex: RedHat 7.2) but you want your code to work
   114         -** on an older machine (ex: RedHat 6.0).  If you compile on RedHat 7.2
   115         -** without this option, LFS is enable.  But LFS does not exist in the kernel
   116         -** in RedHat 6.0, so the code won't work.  Hence, for maximum binary
   117         -** portability you should omit LFS.
   118         -**
   119         -** Similar is true for MacOS.  LFS is only supported on MacOS 9 and later.
   120         -*/
   121         -#ifndef SQLITE_DISABLE_LFS
   122         -# define _LARGE_FILE       1
   123         -# ifndef _FILE_OFFSET_BITS
   124         -#   define _FILE_OFFSET_BITS 64
   125         -# endif
   126         -# define _LARGEFILE_SOURCE 1
   127         -#endif
   128         -
   129    135   #include "sqlite3.h"
   130    136   #include "hash.h"
   131    137   #include "parse.h"
   132    138   #include <stdio.h>
   133    139   #include <stdlib.h>
   134    140   #include <string.h>
   135    141   #include <assert.h>

Changes to tool/mksqlite3c.tcl.

   101    101      sqliteInt.h
   102    102      sqliteLimit.h
   103    103      vdbe.h
   104    104      vdbeInt.h
   105    105   } {
   106    106     set available_hdr($hdr) 1
   107    107   }
   108         -set available_hdr(sqlite3.h) 0
          108  +set available_hdr(sqliteInt.h) 0
   109    109   
   110    110   # 78 stars used for comment formatting.
   111    111   set s78 \
   112    112   {*****************************************************************************}
   113    113   
   114    114   # Insert a comment into the code
   115    115   #
................................................................................
   191    191   
   192    192   
   193    193   # Process the source files.  Process files containing commonly
   194    194   # used subroutines first in order to help the compiler find
   195    195   # inlining opportunities.
   196    196   #
   197    197   foreach file {
   198         -   sqlite3.h
          198  +   sqliteInt.h
   199    199   
   200    200      date.c
   201    201      os.c
   202    202   
   203    203      mem1.c
   204    204      mem2.c
   205    205      mem3.c