lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]



Hi all,
I continue to try compiling lua 5.1-rc with different compilers for Windows.

I tried the freshly released OpenWatcom 1.4 compiler.
Unfortunatelly it has function
  isatty(int __handle);
while luaconf.h believes that compilers under LUA_WIN use
  _isatty.

My current fix is to modify luaconf.h to:

#if defined(LUA_USE_ISATTY)
#include <unistd.h>
#define lua_stdin_is_tty()	isatty(0)
#elif defined(LUA_WIN)
#include <io.h>
#include <stdio.h>
#ifdef __WATCOMC__
#define lua_stdin_is_tty()	isatty(_fileno(stdin))
#else
#define lua_stdin_is_tty()	_isatty(_fileno(stdin))
#endif
#else
#define lua_stdin_is_tty()	1  /* assume stdin is a tty */
#endif

And as Digital Mars compiler does not have popen functions,
I changed luaconf.h to

#if defined(LUA_USE_POPEN)

#define lua_popen(L,c,m)	((void)L, popen(c,m))
#define lua_pclose(L,file)	((void)L, (pclose(file) != -1))

#elif defined(LUA_WIN) && !defined(__DMC__) // Digital Mars lacks popen functions

#define lua_popen(L,c,m)	((void)L, _popen(c,m))
#define lua_pclose(L,file)	((void)L, (_pclose(file) != -1))

#else

#define lua_popen(L,c,m)  \
((void)c, (void)m, luaL_error(L, LUA_QL("popen") " not supported"), (FILE*)0)
#define lua_pclose(L,file)		((void)L, (void)file, 0)

#endif

But I want to ask, what is lua authors opinion of those changes?
Should lua have special configuration for various compilers
or just a README file where it is explained how to modify sources
to make lua compilable?

Regards,
Todor