/ Check-in [e1472307]
Login

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

Overview
Comment:Better support for MinGW 4.x.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | mingw4x
Files: files | file ages | folders
SHA1: e147230767383ed9f64085b613fd18508f74be21
User & Date: mistachkin 2014-02-14 23:35:49
Context
2014-02-16
19:20
Use the modern MinGW major version macro, not the deprecated one. Closed-Leaf check-in: 057c16ee user: mistachkin tags: mingw4x
2014-02-14
23:35
Better support for MinGW 4.x. check-in: e1472307 user: mistachkin tags: mingw4x
20:59
Reduce the number of cases where it is necessary to check for NULL after the loop terminating condition. check-in: 3c1ae447 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/sqliteInt.h.

    44     44   # define _LARGE_FILE       1
    45     45   # ifndef _FILE_OFFSET_BITS
    46     46   #   define _FILE_OFFSET_BITS 64
    47     47   # endif
    48     48   # define _LARGEFILE_SOURCE 1
    49     49   #endif
    50     50   
           51  +/*
           52  +** For MinGW, check to see if we can include the header file containing its
           53  +** version information, among other things.  Normally, this internal MinGW
           54  +** header file would [only] be included automatically by other MinGW header
           55  +** files; however, the contained version information is now required by this
           56  +** header file to work around binary compatibility issues (see below) and
           57  +** this is the only known way to reliably obtain it.  This entire #if block
           58  +** would be completely unnecessary if there was any other way of detecting
           59  +** MinGW via their preprocessor (e.g. if they customized their GCC to define
           60  +** some MinGW-specific macros).  When compiling for MinGW, either the
           61  +** _HAVE_MINGW_H or _HAVE__MINGW_H (note the extra underscore) macro must be
           62  +** defined; otherwise, detection of conditions specific to MinGW will be
           63  +** disabled.
           64  +*/
           65  +#if defined(_HAVE_MINGW_H)
           66  +# include "mingw.h"
           67  +#elif defined(_HAVE__MINGW_H)
           68  +# include "_mingw.h"
           69  +#endif
           70  +
           71  +/*
           72  +** For MinGW version 4.x (and higher), check to see if the _USE_32BIT_TIME_T
           73  +** define is required to maintain binary compatibility with the MSVC runtime
           74  +** library in use (e.g. for Windows XP).
           75  +*/
           76  +#if !defined(_USE_32BIT_TIME_T) && !defined(_USE_64BIT_TIME_T) && \
           77  +    defined(_WIN32) && !defined(_WIN64) && \
           78  +    defined(__MINGW32_MAJOR_VERSION) && __MINGW32_MAJOR_VERSION >= 4 && \
           79  +    defined(__MSVCRT__)
           80  +# define _USE_32BIT_TIME_T
           81  +#endif
           82  +
    51     83   /*
    52     84   ** Include the configuration header output by 'configure' if we're using the
    53     85   ** autoconf-based build
    54     86   */
    55     87   #ifdef _HAVE_SQLITE_CONFIG_H
    56     88   #include "config.h"
    57     89   #endif