fix lua tmpname() vs mkstemp() on linux

Avoid the warning that tmpname should be replaced by mkstemp by
replacing tmpname with mkstemp.  lua has code to do that but it isn't
trivial to activate while leaving the lua distribution unmodified.
[I've no idea whether nethack's usage even results in liblua ever
creating any temporary files.]

Using nethack's hints to pass -DLUA_USE_POSIX from top Makefile to
lib/lua-$(LUA_VERSION)/Makefile has been tested, building liblua.a
on linux with that has not.
This commit is contained in:
PatR
2020-05-18 12:01:23 -07:00
parent 82ccfaa3ac
commit ce5eebcb9b
7 changed files with 39 additions and 8 deletions

View File

@@ -1,5 +1,5 @@
#
# NetHack 3.6 linux $NHDT-Date: 1432512814 2018/11/23 16:00:00 $ $NHDT-Branch: master $:$NHDT-Revision: 1.12 $
# NetHack 3.6 linux $NHDT-Date: 1589828479 2020/05/18 19:01:19 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.1 $
# Copyright (c) Patric Mueller
# NetHack may be freely redistributed. See license for details.
#
@@ -15,6 +15,11 @@ VARDIR=$(HACKDIR)
CFLAGS=-g -I../include
# when building liblua.a, avoid warning that use of tmpnam() should be
# replaced by mkstemp(); the lua code doesn't use nethack's config.h so
# this needs to be passed via make rather than defined in unixconf.h
SYSCFLAGS=-DLUA_USE_POSIX
LINK=$(CC)
WINSRC = $(WINTTYSRC)