/ Check-in [7c7b7f26]
Login

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

Overview
Comment:Avoid a harmless compiler warning on systems where the byteorder cannot be determined at compile-time.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:7c7b7f26306b6aa6ff35b871ad756f43f5db9838
User & Date: drh 2015-12-24 14:53:27
Context
2015-12-30
01:07
Add the json_group_array() and json_group_object() aggregate functions to the JSON1 extension. check-in: 7f386a93 user: drh tags: trunk
2015-12-24
14:53
Avoid a harmless compiler warning on systems where the byteorder cannot be determined at compile-time. check-in: 7c7b7f26 user: drh tags: trunk
2015-12-23
16:42
Fix some harmless gcc compiler warnings. Mostly in fts5, but also two in the core code. check-in: 5d44d4a6 user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/sqliteInt.h.

   688    688   ** and whether or not that determination is run-time or compile-time.
   689    689   **
   690    690   ** For best performance, an attempt is made to guess at the byte-order
   691    691   ** using C-preprocessor macros.  If that is unsuccessful, or if
   692    692   ** -DSQLITE_RUNTIME_BYTEORDER=1 is set, then byte-order is determined
   693    693   ** at run-time.
   694    694   */
   695         -#ifdef SQLITE_AMALGAMATION
   696         -const int sqlite3one = 1;
   697         -#else
   698         -extern const int sqlite3one;
   699         -#endif
   700    695   #if (defined(i386)     || defined(__i386__)   || defined(_M_IX86) ||    \
   701    696        defined(__x86_64) || defined(__x86_64__) || defined(_M_X64)  ||    \
   702    697        defined(_M_AMD64) || defined(_M_ARM)     || defined(__x86)   ||    \
   703    698        defined(__arm__)) && !defined(SQLITE_RUNTIME_BYTEORDER)
   704    699   # define SQLITE_BYTEORDER    1234
   705    700   # define SQLITE_BIGENDIAN    0
   706    701   # define SQLITE_LITTLEENDIAN 1
................................................................................
   710    705       && !defined(SQLITE_RUNTIME_BYTEORDER)
   711    706   # define SQLITE_BYTEORDER    4321
   712    707   # define SQLITE_BIGENDIAN    1
   713    708   # define SQLITE_LITTLEENDIAN 0
   714    709   # define SQLITE_UTF16NATIVE  SQLITE_UTF16BE
   715    710   #endif
   716    711   #if !defined(SQLITE_BYTEORDER)
          712  +# ifdef SQLITE_AMALGAMATION
          713  +  const int sqlite3one = 1;
          714  +# else
          715  +  extern const int sqlite3one;
          716  +# endif
   717    717   # define SQLITE_BYTEORDER    0     /* 0 means "unknown at compile-time" */
   718    718   # define SQLITE_BIGENDIAN    (*(char *)(&sqlite3one)==0)
   719    719   # define SQLITE_LITTLEENDIAN (*(char *)(&sqlite3one)==1)
   720    720   # define SQLITE_UTF16NATIVE  (SQLITE_BIGENDIAN?SQLITE_UTF16BE:SQLITE_UTF16LE)
   721    721   #endif
   722    722   
   723    723   /*

Changes to src/utf.c.

    33     33   **     0xfe 0xff   big-endian utf-16 follows
    34     34   **
    35     35   */
    36     36   #include "sqliteInt.h"
    37     37   #include <assert.h>
    38     38   #include "vdbeInt.h"
    39     39   
    40         -#ifndef SQLITE_AMALGAMATION
           40  +#if !defined(SQLITE_AMALGAMATION) && SQLITE_BYTEORDER==0
    41     41   /*
    42     42   ** The following constant value is used by the SQLITE_BIGENDIAN and
    43     43   ** SQLITE_LITTLEENDIAN macros.
    44     44   */
    45     45   const int sqlite3one = 1;
    46         -#endif /* SQLITE_AMALGAMATION */
           46  +#endif /* SQLITE_AMALGAMATION && SQLITE_BYTEORDER==0 */
    47     47   
    48     48   /*
    49     49   ** This lookup table is used to help decode the first byte of
    50     50   ** a multi-byte UTF8 character.
    51     51   */
    52     52   static const unsigned char sqlite3Utf8Trans1[] = {
    53     53     0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,