I cannot get STEPWAT2 to compile on Apple silicon chips. I get errors pointing to undeclared identifier "sqlite3one" in sqlite-amalgamation/sqlite3.c.
I tested on two different computers (Apple M1 Max under macOS v12.6.3; Apple M1 under macOS v13.1) with different compilers (GNU gcc v12.2.0; Apple clang v14.0.0).
I have no problems to compile and run STEPWAT2 on Intel chips under macOS.
I am not familiar with the sqlite-functionality of STEPWAT2; I couldn't find a way to turn it off even though it appears to be used only for debugging.
Given that Apple silicon uses little endian (as do Intel chips), I get it to compile and run when I add a defined(__arm64__) to line 8868 of sqlite-amalgamation/sqlite3.c and it produces exactly the same output as on an Intel chip. @kpalmqui are you ok with me making this fix?
The error messages I get are
from GNU gcc v12.2.0
sqlite-amalgamation/sqlite3.c: In function 'sqlite3Utf16ByteLen':
sqlite-amalgamation/sqlite3.c:8886:42: error: 'sqlite3one' undeclared (first use in this function); did you mean 'sqlite3Prng'?
8886 | # define SQLITE_BIGENDIAN (*(char *)(&sqlite3one)==0)
| ^~~~~~~~~~
sqlite-amalgamation/sqlite3.c:8888:31: note: in expansion of macro 'SQLITE_BIGENDIAN'
8888 | # define SQLITE_UTF16NATIVE (SQLITE_BIGENDIAN?SQLITE_UTF16BE:SQLITE_UTF16LE)
| ^~~~~~~~~~~~~~~~
sqlite-amalgamation/sqlite3.c:23064:7: note: in expansion of macro 'SQLITE_UTF16NATIVE'
23064 | if( SQLITE_UTF16NATIVE==SQLITE_UTF16BE ){
| ^~~~~~~~~~~~~~~~~~
sqlite-amalgamation/sqlite3.c:8886:42: note: each undeclared identifier is reported only once for each function it appears in
8886 | # define SQLITE_BIGENDIAN (*(char *)(&sqlite3one)==0)
| ^~~~~~~~~~
...
* from Apple clang v14.0.0
sqlite-amalgamation/sqlite3.c:23064:7: error: use of undeclared identifier 'sqlite3one'
if( SQLITE_UTF16NATIVE==SQLITE_UTF16BE ){
^
sqlite-amalgamation/sqlite3.c:8888:31: note: expanded from macro 'SQLITE_UTF16NATIVE'
I cannot get STEPWAT2 to compile on Apple silicon chips. I get errors pointing to undeclared identifier "sqlite3one" in
sqlite-amalgamation/sqlite3.c
.I tested on two different computers (Apple M1 Max under macOS v12.6.3; Apple M1 under macOS v13.1) with different compilers (GNU gcc v12.2.0; Apple clang v14.0.0).
I have no problems to compile and run STEPWAT2 on Intel chips under macOS.
I am not familiar with the sqlite-functionality of STEPWAT2; I couldn't find a way to turn it off even though it appears to be used only for debugging.
Given that Apple silicon uses little endian (as do Intel chips), I get it to compile and run when I add a
defined(__arm64__)
to line 8868 ofsqlite-amalgamation/sqlite3.c
and it produces exactly the same output as on an Intel chip. @kpalmqui are you ok with me making this fix?The error messages I get are
...
sqlite-amalgamation/sqlite3.c:23064:7: error: use of undeclared identifier 'sqlite3one' if( SQLITE_UTF16NATIVE==SQLITE_UTF16BE ){ ^ sqlite-amalgamation/sqlite3.c:8888:31: note: expanded from macro 'SQLITE_UTF16NATIVE'
define SQLITE_UTF16NATIVE (SQLITE_BIGENDIAN?SQLITE_UTF16BE:SQLITE_UTF16LE)
sqlite-amalgamation/sqlite3.c:8886:42: note: expanded from macro 'SQLITE_BIGENDIAN'
define SQLITE_BIGENDIAN ((char )(&sqlite3one)==0)
...