Bug: "#if SQLITE_INT64_TYPE" should be "#ifdef SQLITE_INT64_TYPE"

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Bug: "#if SQLITE_INT64_TYPE" should be "#ifdef SQLITE_INT64_TYPE"

Taylor Brown
As of Sqlite 3.2.0, the following code was added (by tool/mkctime.tcl?)


This compiles fine for SQLite, but when we are running this through the
Emscripten compiler (a C compiler that compiles to LLVM), we get the
following error:

c/sqlite3.c:385:5: error: token is not a valid binary operator in a
preprocessor subexpression
:8:32: note: expanded from here
#define SQLITE_INT64_TYPE long long int
~~~~ ^
1 error generated.

It looks like this should have been written as `#ifdef SQLITE_INT64_TYPE`
instead of `#if SQLITE_INT64_TYPE`. You will notice that later on in the
code, it is indeed written as `#ifdef SQLITE_INT64_TYPE`.
As I mentioned, this does compile correctly with SQLite's default
toolchain, but I'm not sure why, as the error above makes sense to me. I
realize it's not your responsibility to fix bugs that only show up in
alternative C compilers, but it would save us some pre-processing if this
could be fixed in the codebase.

Many thanks,

sqlite-users mailing list
[hidden email]