lunarmodules / luasql

LuaSQL is a simple interface from Lua to a DBMS.
http://lunarmodules.github.io/luasql
535 stars 192 forks source link

src/ls_mysql.c:606:25: error: expected ‘)’ before ‘MYSQL_SERVER_VERSION’ #85

Closed manwe-pl closed 5 years ago

manwe-pl commented 6 years ago
 * building mysql module
make -j5 mysql T=mysql LUA_VERSION_NUM=0 'CFLAGS=-O2 -pipe -march=corei7 -mtune=generic -fPIC' DRIVER_LIBS=-lmysqlclient -lz 
gcc -O2 -pipe -march=corei7 -mtune=generic -fPIC -c src/luasql.c -o src/luasql.o
gcc -O2 -pipe -march=corei7 -mtune=generic -fPIC src/ls_mysql.c -o src/mysql.so -shared src/luasql.o -I/usr/include/mysql -L/usr/lib -lmysqlclient -lz
In file included from src/ls_mysql.c:21:0:
src/ls_mysql.c: In function ‘luaopen_luasql_mysql’:
src/ls_mysql.c:606:25: error: expected ‘)’ before ‘MYSQL_SERVER_VERSION’
     lua_pushliteral (L, MYSQL_SERVER_VERSION);
                         ^
src/ls_mysql.c:606:5: error: too few arguments to function ‘lua_pushlstring’
     lua_pushliteral (L, MYSQL_SERVER_VERSION);
     ^
/usr/include/lua.h:163:16: note: declared here
 LUA_API void  (lua_pushlstring) (lua_State *L, const char *s, size_t l);
                ^~~~~~~~~~~~~~~
make: *** [Makefile:24: src/mysql.so] Error 1
manwe-pl commented 6 years ago
# lua -v
Lua 5.1.5  Copyright (C) 1994-2012 Lua.org, PUC-Rio
# mysql --version
mysql  Ver 15.1 Distrib 10.2.11-MariaDB, for Linux (x86_64) using readline 7.0
volga629 commented 6 years ago

Same here are rpmbuild failing.

+ make sqlite3 -j3 PREFIX=/usr DRIVER_INCS= 'DRIVER_LIBS=-lsqlite3 ' T=sqlite3 'DEFS=-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -fPIC -std=c99 -DLUA_COMPAT_APIINTCASTS'
+ make postgres -j3 PREFIX=/usr DRIVER_INCS= DRIVER_LIBS=-lpq T=postgres 'DEFS=-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -fPIC -std=c99 -DLUA_COMPAT_APIINTCASTS' WARN=
+ make mysql -j3 PREFIX=/usr DRIVER_INCS=-I/usr/include/mysql 'DRIVER_LIBS=-L/usr/lib64/mysql -lmysqlclient' T=mysql 'DEFS=-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -fPIC -std=c99 -DLUA_COMPAT_APIINTCASTS'
In file included from src/ls_mysql.c:21:0:
src/ls_mysql.c: In function 'luaopen_luasql_mysql':
src/ls_mysql.c:606:25: error: expected ')' before 'MYSQL_SERVER_VERSION'
     lua_pushliteral (L, MYSQL_SERVER_VERSION);
                         ^
make: *** [Makefile:24: src/mysql.so] Error 1
error: Bad exit status from /var/tmp/rpm-tmp.KwGe30 (%build)
    Bad exit status from /var/tmp/rpm-tmp.KwGe30 (%build)
tomasguisasola commented 5 years ago

ifdef'ed