]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Patch around compilers that do not support "long long int". (CVS 1656)
authordrh <drh@noemail.net>
Tue, 22 Jun 2004 12:13:55 +0000 (12:13 +0000)
committerdrh <drh@noemail.net>
Tue, 22 Jun 2004 12:13:55 +0000 (12:13 +0000)
FossilOrigin-Name: d98b1502e2947d24ab9f4a5d2e5b9a95dde92faf

manifest
manifest.uuid
src/main.c
src/printf.c
src/sqlite.h.in
src/sqliteInt.h
src/vdbeInt.h
src/vdbeapi.c

index ba89d7e0088b3ce902e8d494b49b7992b9e5a759..c2dfdd500767b37aa7a0e3e18b9142eb15a193c7 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Add\sos_test.c.\sNot\sactivated\syet.\s(CVS\s1655)
-D 2004-06-22T11:29:02
+C Patch\saround\scompilers\sthat\sdo\snot\ssupport\s"long\slong\sint".\s(CVS\s1656)
+D 2004-06-22T12:13:55
 F Makefile.in 0a3d7aaefa50717bd550b0cf568a51072c4c103c
 F Makefile.linux-gcc a9e5a0d309fa7c38e7c14d3ecf7690879d3a5457
 F README f1de682fbbd94899d50aca13d387d1b3fd3be2dd
@@ -38,7 +38,7 @@ F src/hash.c 440c2f8cb373ee1b4e13a0988489c7cd95d55b6f
 F src/hash.h 762d95f1e567664d1eafc1687de755626be962fb
 F src/insert.c d99ffe87e1e1397f4233afcd06841d52d6b17b18
 F src/legacy.c ad23746f15f67e34577621b1875f639c94839e1f
-F src/main.c 5bf387a22ff6e17c8e60d2fbb940e98a78f5d501
+F src/main.c 2a4f3fe32ee6357b5b914ab5e2bd0979202570f4
 F src/md5.c 7ae1c39044b95de2f62e066f47bb1deb880a1070
 F src/os.h 2f5ea879b784bc82aac8022a3e8fe00b73c83d67
 F src/os_common.h ba1b7306e16e2091718f2c48db0fe6c1d7a31bb8
@@ -54,12 +54,12 @@ F src/pager.c d9d3f577319ebac6670d3f44eca46060b78ee6b2
 F src/pager.h bc58d32a9dee464f7268fb68652c130a4216e438
 F src/parse.y 097438674976355a10cf177bd97326c548820b86
 F src/pragma.c 0750e1c360647dbe0a991f16133b0fe5e42e5039
-F src/printf.c 823b6a5cbedb6971a9e62f5d83204fe9b0be7c1b
+F src/printf.c afe30ac12d12afad294b4bceebc07316ed8ee171
 F src/random.c eff68e3f257e05e81eae6c4d50a51eb88beb4ff3
 F src/select.c f02a65af34231031896e8442161cb5251e191e75
 F src/shell.c 24b641700c9d90f361fcfa4f432c5b4aff704e6d
-F src/sqlite.h.in a3d593016d1a1a514d7a26c8a353b58caf62e798
-F src/sqliteInt.h 0aa0b24208eeb46290baf8b6ae5ca36fed8a58d3
+F src/sqlite.h.in 1f400a561fca3b1df73677d2d97046425d47cae4
+F src/sqliteInt.h dd796b6abc6d50505fe33c54f0143d7000681a41
 F src/table.c af14284fa36c8d41f6829e3f2819dce07d3e2de2
 F src/tclsqlite.c 8d093146332b2f0cbf2a8ebe8597d481619308a3
 F src/test1.c ee426e026ad9223483e7a84bb68849fc6e9f542e
@@ -75,8 +75,8 @@ F src/util.c e31e35d3d76cab7a02045095064897eca49cbce3
 F src/vacuum.c fcb930215a3f6c50087300782555f61ad11dd80c
 F src/vdbe.c 5da73f61016b1874d935b522bab6ca8b5aa15216
 F src/vdbe.h 2d87155e31e84bb00cdc48cc1ce6987a3a484250
-F src/vdbeInt.h c0740932621a8d4aac20e0c4235ce44eb5e8dce6
-F src/vdbeapi.c 8a9421341e09b506a934132c9015f26362ae8c0e
+F src/vdbeInt.h 0b8eda5e0a1331d23b38d7888f187119a3491b40
+F src/vdbeapi.c d3659f3f2982e79c06ab8e338604a39e0ea0d2d3
 F src/vdbeaux.c 9fe01087f2ddc410827b6e124fc423d429e6f5a1
 F src/vdbemem.c 9359c53386e070fea9f5403cab0c6f0cfe36496b
 F src/where.c 6507074d8ce3f78e7a4cd33f667f11e62020553e
@@ -227,7 +227,7 @@ F www/tclsqlite.tcl 19191cf2a1010eaeff74c51d83fd5f5a4d899075
 F www/vdbe.tcl 59288db1ac5c0616296b26dce071c36cb611dfe9
 F www/version3.tcl af528563442e3039928f9018327a18157e53a44f
 F www/whentouse.tcl a8335bce47cc2fddb07f19052cb0cb4d9129a8e4
-P 819a5973d15bf619182e47abd9b9dca2a560d8ff
-R 9995119681c1ca663fd04d3e87f63e78
-U danielk1977
-Z 48006eb9b98a86dcff4611e010a83567
+P d16b863849d1aa887fe403e25153b1e9df6b837e
+R 85dc3ae43867f14feba3557419001a96
+U drh
+Z bbfe7d28a769302b653c6e45868a429e
index 592c07de04ab641042118bdb37392a41f6d09d93..c801fc4453d7eed267a237dcdb0f13d80e53feda 100644 (file)
@@ -1 +1 @@
-d16b863849d1aa887fe403e25153b1e9df6b837e
\ No newline at end of file
+d98b1502e2947d24ab9f4a5d2e5b9a95dde92faf
\ No newline at end of file
index 04d0d75d921a097651e7f98fe9839a1cab4fb9f0..20f7983d601f942c92b03712e4efc12a202321df 100644 (file)
@@ -14,7 +14,7 @@
 ** other files are for internal use by SQLite and should not be
 ** accessed by users of the library.
 **
-** $Id: main.c,v 1.232 2004/06/21 08:18:52 danielk1977 Exp $
+** $Id: main.c,v 1.233 2004/06/22 12:13:55 drh Exp $
 */
 #include "sqliteInt.h"
 #include "os.h"
@@ -436,7 +436,7 @@ static int nocaseCollatingFunc(
 /*
 ** Return the ROWID of the most recent insert
 */
-long long int sqlite3_last_insert_rowid(sqlite *db){
+sqlite_int64 sqlite3_last_insert_rowid(sqlite *db){
   return db->lastRowid;
 }
 
index 6d1059655ee60155e67828b7d9a8b218eb0d1bda..cb03b3dc1c70eb492c88dd29846e4b33fa66a2d9 100644 (file)
@@ -345,7 +345,7 @@ static int vxprintf(
     */
     switch( xtype ){
       case etRADIX:
-        if( flag_longlong )   longvalue = va_arg(ap,INT64_TYPE);
+        if( flag_longlong )   longvalue = va_arg(ap,sqlite_int64);
         else if( flag_long )  longvalue = va_arg(ap,long int);
         else                  longvalue = va_arg(ap,int);
 #if 1
index aba3017b6b976736a7c80756856c205d6ba65e33..e532aea86d8cbd9078857957430d6630579a844d 100644 (file)
@@ -12,7 +12,7 @@
 ** This header file defines the interface that the SQLite library
 ** presents to client programs.
 **
-** @(#) $Id: sqlite.h.in,v 1.105 2004/06/21 06:50:28 danielk1977 Exp $
+** @(#) $Id: sqlite.h.in,v 1.106 2004/06/22 12:13:55 drh Exp $
 */
 #ifndef _SQLITE_H_
 #define _SQLITE_H_
@@ -44,6 +44,18 @@ extern const char sqlite3_version[];
 typedef struct sqlite sqlite3;
 
 
+/*
+** Some compilers do not support the "long long" datatype.  So we have
+** to do a typedef that for 64-bit integers that depends on what compiler
+** is being used.
+*/
+#if defined(_MSC_VER) || defined(__BORLANDC__)
+  typedef __int64 sqlite_int64;
+#else
+  typedef long long int sqlite_int64;
+#endif
+
+
 /*
 ** A function to close the database.
 **
@@ -152,7 +164,7 @@ int sqlite3_exec(
 **
 ** This function is similar to the mysql_insert_id() function from MySQL.
 */
-long long int sqlite3_last_insert_rowid(sqlite3*);
+sqlite_int64 sqlite3_last_insert_rowid(sqlite3*);
 
 /*
 ** This function returns the number of database rows that were changed
@@ -623,7 +635,7 @@ typedef struct Mem sqlite3_value;
 int sqlite3_bind_blob(sqlite3_stmt*, int, const void*, int n, void(*)(void*));
 int sqlite3_bind_double(sqlite3_stmt*, int, double);
 int sqlite3_bind_int(sqlite3_stmt*, int, int);
-int sqlite3_bind_int64(sqlite3_stmt*, int, long long int);
+int sqlite3_bind_int64(sqlite3_stmt*, int, sqlite_int64);
 int sqlite3_bind_null(sqlite3_stmt*, int);
 int sqlite3_bind_text(sqlite3_stmt*, int, const char*, int n, void(*)(void*));
 int sqlite3_bind_text16(sqlite3_stmt*, int, const void*, int, void(*)(void*));
@@ -802,7 +814,7 @@ int sqlite3_column_bytes(sqlite3_stmt*, int iCol);
 int sqlite3_column_bytes16(sqlite3_stmt*, int iCol);
 double sqlite3_column_double(sqlite3_stmt*, int iCol);
 int sqlite3_column_int(sqlite3_stmt*, int iCol);
-long long int sqlite3_column_int64(sqlite3_stmt*, int iCol);
+sqlite_int64 sqlite3_column_int64(sqlite3_stmt*, int iCol);
 const unsigned char *sqlite3_column_text(sqlite3_stmt*, int iCol);
 const void *sqlite3_column_text16(sqlite3_stmt*, int iCol);
 int sqlite3_column_type(sqlite3_stmt*, int iCol);
@@ -908,7 +920,7 @@ int sqlite3_value_bytes(sqlite3_value*);
 int sqlite3_value_bytes16(sqlite3_value*);
 double sqlite3_value_double(sqlite3_value*);
 int sqlite3_value_int(sqlite3_value*);
-long long int sqlite3_value_int64(sqlite3_value*);
+sqlite_int64 sqlite3_value_int64(sqlite3_value*);
 const unsigned char *sqlite3_value_text(sqlite3_value*);
 const void *sqlite3_value_text16(sqlite3_value*);
 const void *sqlite3_value_text16le(sqlite3_value*);
@@ -986,7 +998,7 @@ void sqlite3_result_double(sqlite3_context*, double);
 void sqlite3_result_error(sqlite3_context*, const char*, int);
 void sqlite3_result_error16(sqlite3_context*, const void*, int);
 void sqlite3_result_int(sqlite3_context*, int);
-void sqlite3_result_int64(sqlite3_context*, long long int);
+void sqlite3_result_int64(sqlite3_context*, sqlite_int64);
 void sqlite3_result_null(sqlite3_context*);
 void sqlite3_result_text(sqlite3_context*, const char*, int, void(*)(void*));
 void sqlite3_result_text16(sqlite3_context*, const void*, int, void(*)(void*));
index a2a818f83f599a00341e4e6711708b8bad2c7839..e6ad4a517dfe2aa6e09efb5743e079be8d59169e 100644 (file)
@@ -11,7 +11,7 @@
 *************************************************************************
 ** Internal interface definitions for SQLite.
 **
-** @(#) $Id: sqliteInt.h,v 1.298 2004/06/22 11:29:02 danielk1977 Exp $
+** @(#) $Id: sqliteInt.h,v 1.299 2004/06/22 12:13:55 drh Exp $
 */
 #ifndef _SQLITEINT_H_
 #define _SQLITEINT_H_
 **
 **         cc '-DUINTPTR_TYPE=long long int' ...
 */
-#ifndef INT64_TYPE
-# define INT64_TYPE long long int
-#endif
 #ifndef UINT64_TYPE
-# define UINT64_TYPE unsigned long long int
+# if defined(_MSC_VER) || defined(__BORLANDC__)
+#   define UINT64_TYPE unsigned __int64
+# else
+#   define UINT64_TYPE unsigned long long int
+# endif
 #endif
 #ifndef UINT32_TYPE
 # define UINT32_TYPE unsigned int
 #ifndef INT8_TYPE
 # define INT8_TYPE signed char
 #endif
+#ifndef LONGDOUBLE_TYPE
+# define LONGDOUBLE_TYPE long double
+#endif
 #ifndef INTPTR_TYPE
 # if SQLITE_PTR_SZ==4
 #   define INTPTR_TYPE int
 # else
-#   define INTPTR_TYPE long long
+#   define INTPTR_TYPE sqlite_int64
 # endif
 #endif
-typedef INT64_TYPE i64;            /* 8-byte signed integer */
+typedef sqlite_int64 i64;          /* 8-byte signed integer */
 typedef UINT64_TYPE u64;           /* 8-byte unsigned integer */
 typedef UINT32_TYPE u32;           /* 4-byte unsigned integer */
 typedef UINT16_TYPE u16;           /* 2-byte unsigned integer */
@@ -149,15 +153,6 @@ typedef struct sqlite sqlite;
 #include "vdbe.h"
 #include "btree.h"
 
-/*
-** Most C compilers these days recognize "long double", don't they?
-** Just in case we encounter one that does not, we will create a macro
-** for long double so that it can be easily changed to just "double".
-*/
-#ifndef LONGDOUBLE_TYPE
-# define LONGDOUBLE_TYPE long double
-#endif
-
 /*
 ** This macro casts a pointer to an integer.  Useful for doing
 ** pointer arithmetic.
index f5b3673b641b21e25a8cfbc551ec9a51f06d756f..688380dd0da87959e59d722b0ae2cfcac3cc7135 100644 (file)
@@ -385,7 +385,7 @@ int sqlite3VdbeMemCopy(Mem*, const Mem*);
 int sqlite3VdbeMemMove(Mem*, Mem*);
 int sqlite3VdbeMemNulTerminate(Mem*);
 int sqlite3VdbeMemSetStr(Mem*, const char*, int, u8, void(*)(void*));
-void sqlite3VdbeMemSetInt64(Mem*, long long int);
+void sqlite3VdbeMemSetInt64(Mem*, i64);
 void sqlite3VdbeMemSetDouble(Mem*, double);
 void sqlite3VdbeMemSetNull(Mem*);
 int sqlite3VdbeMemMakeWriteable(Mem*);
index 7be483463d039967ddc24d451d33f078129a9b31..ca488315c7b7e157639e0b31a4a651396761c9ce 100644 (file)
@@ -52,7 +52,7 @@ int sqlite3_value_int(sqlite3_value *pVal){
   sqlite3VdbeMemIntegerify(pMem);
   return (int)pVal->i;
 }
-long long int sqlite3_value_int64(sqlite3_value *pVal){
+sqlite_int64 sqlite3_value_int64(sqlite3_value *pVal){
   Mem *pMem = (Mem *)pVal;
   sqlite3VdbeMemIntegerify(pMem);
   return pVal->i;
@@ -324,7 +324,7 @@ double sqlite3_column_double(sqlite3_stmt *pStmt, int i){
 int sqlite3_column_int(sqlite3_stmt *pStmt, int i){
   return sqlite3_value_int( columnMem(pStmt,i) );
 }
-long long int sqlite3_column_int64(sqlite3_stmt *pStmt, int i){
+sqlite_int64 sqlite3_column_int64(sqlite3_stmt *pStmt, int i){
   return sqlite3_value_int64( columnMem(pStmt,i) );
 }
 const unsigned char *sqlite3_column_text(sqlite3_stmt *pStmt, int i){
@@ -468,9 +468,9 @@ int sqlite3_bind_double(sqlite3_stmt *pStmt, int i, double rValue){
   return SQLITE_OK;
 }
 int sqlite3_bind_int(sqlite3_stmt *p, int i, int iValue){
-  return sqlite3_bind_int64(p, i, (long long int)iValue);
+  return sqlite3_bind_int64(p, i, (i64)iValue);
 }
-int sqlite3_bind_int64(sqlite3_stmt *pStmt, int i, long long int iValue){
+int sqlite3_bind_int64(sqlite3_stmt *pStmt, int i, sqlite_int64 iValue){
   int rc;
   Vdbe *p = (Vdbe *)pStmt;
   rc = vdbeUnbind(p, i);