sqlite icon indicating copy to clipboard operation
sqlite copied to clipboard

More HAVE_* defines

Open mdevan opened this issue 6 years ago • 1 comments

You might want to add the following HAVE_* defines in sqlite.go:

#cgo CFLAGS: -DHAVE_FDATASYNC
#cgo CFLAGS: -DHAVE_GMTIME_R
#cgo CFLAGS: -DHAVE_ISNAN
#cgo CFLAGS: -DHAVE_LOCALTIME_R
#cgo linux CFLAGS: -DHAVE_STRCHRNUL
#cgo CFLAGS: -DHAVE_UTIME
#cgo CFLAGS: -DHAVE_STRERROR_R

These are true for most modern (g)libc systems. If you build from the un-amalgamated source, these are set by the configure script, but if you use sqlite3.c (like here), some are guessed, some are not (and built-in, slower implementations are substituted -- for example, osLocalTime() will lock a mutex and call localtime() if HAVE_LOCALTIME_R is not defined).

mdevan avatar Aug 11 '18 05:08 mdevan

HAVE_UTIME is there as of a few days ago.

Some of the others look reasonable, but I need to confirm what the values should be on different OSs. E.g. should macOS use HAVE_FDATASYNC? A quick run of the sqlite configure script should answer it.

crawshaw avatar Aug 13 '18 16:08 crawshaw