branch: elpa/emacsql commit 5bef799b6b2288f9fd5f6369b7d25e680897d0d5 Author: Christopher Wellons <well...@nullprogram.com> Commit: Christopher Wellons <well...@nullprogram.com>
Make some tweaks to accommodate Windows. --- sqlite/Makefile | 11 +++++++++-- sqlite/emacsql.c | 5 ++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/sqlite/Makefile b/sqlite/Makefile index 3679e6f93c..4e47907d27 100644 --- a/sqlite/Makefile +++ b/sqlite/Makefile @@ -1,5 +1,12 @@ -BINARY = emacsql-sqlite-$(shell uname -sm | tr '[A-Z]' '[a-z]' | tr ' ' '-') -LDLIBS = -ldl +ifeq ($(OS),Windows_NT) + OSTUPLE = windows-x86 + BINARY = emacsql-sqlite-$(OSTUPLE).exe +else + OSTUPLE = $(shell uname -sm | tr '[A-Z]' '[a-z]' | tr ' ' '-') + BINARY = emacsql-sqlite-$(OSTUPLE) + LDLIBS = -ldl +endif + CFLAGS = -O2 --std=c99 -W -Wall -Wextra CFLAGS += -DSQLITE_THREADSAFE=0 CFLAGS += -DSQLITE_DEFAULT_FOREIGN_KEYS=1 diff --git a/sqlite/emacsql.c b/sqlite/emacsql.c index bb163aa578..3a65f540eb 100644 --- a/sqlite/emacsql.c +++ b/sqlite/emacsql.c @@ -80,10 +80,9 @@ int main(int argc, char **argv) { fflush(stdout); /* Gather input from Emacs. */ - size_t length; - int result = scanf("%zu ", &length); + unsigned length; + int result = scanf("%u ", &length); if (result == EOF) { - printf("EOF DETECTED\n"); break; } else if (result != 1) { send_error(SQLITE_ERROR, "middleware parsing error");