[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: PATCH: file:close() return-value for pipes
- From: David Favro <lua@...>
- Date: Wed, 19 Jan 2011 08:32:56 -0500
On 01/19/2011 06:22 AM, Luiz Henrique de Figueiredo wrote:
>> This is really two changes, one which fixes the just-plain-wrong behavior of
>> the return-value of file:close() when called on a pipe on Linux (and
>> presumably also other posix platforms)
>
> Thanks for your patch but Lua targets ANSI C platforms not POSIX.
> We prefer to avoid #ifdefs in the main code.
By "in the main code" I guess you mean "in .c files, rather than in .h
files"? Because the file that I patched, liolib.c, is full of #if's, for
example on LUA_USE_POPEN, which is defined in luaconf.h, based on
LUA_USE_POSIX, which is defined in luaconf.h based on LUA_USE_LINUX, which
is what I #if'd on. But one could certainly define another macro,
LUA_USE_WAIT, in luaconf.h based on LUA_USE_LINUX, and then #if in the .c
file based on that rather than LUA_USE_LINUX as I did.