mirror of https://github.com/lua/lua
added 'l_' prefix for names that can be redefined externally
This commit is contained in:
parent
d7a0179cd6
commit
6b12b82532
10
lauxlib.c
10
lauxlib.c
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
** $Id: lauxlib.c,v 1.268 2014/09/22 06:42:15 roberto Exp roberto $
|
||||
** $Id: lauxlib.c,v 1.269 2014/10/17 16:28:21 roberto Exp roberto $
|
||||
** Auxiliary functions for building Lua libraries
|
||||
** See Copyright Notice in lua.h
|
||||
*/
|
||||
|
@ -229,7 +229,7 @@ LUALIB_API int luaL_fileresult (lua_State *L, int stat, const char *fname) {
|
|||
}
|
||||
|
||||
|
||||
#if !defined(inspectstat) /* { */
|
||||
#if !defined(l_inspectstat) /* { */
|
||||
|
||||
#if defined(LUA_USE_POSIX)
|
||||
|
||||
|
@ -238,13 +238,13 @@ LUALIB_API int luaL_fileresult (lua_State *L, int stat, const char *fname) {
|
|||
/*
|
||||
** use appropriate macros to interpret 'pclose' return status
|
||||
*/
|
||||
#define inspectstat(stat,what) \
|
||||
#define l_inspectstat(stat,what) \
|
||||
if (WIFEXITED(stat)) { stat = WEXITSTATUS(stat); } \
|
||||
else if (WIFSIGNALED(stat)) { stat = WTERMSIG(stat); what = "signal"; }
|
||||
|
||||
#else
|
||||
|
||||
#define inspectstat(stat,what) /* no op */
|
||||
#define l_inspectstat(stat,what) /* no op */
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -256,7 +256,7 @@ LUALIB_API int luaL_execresult (lua_State *L, int stat) {
|
|||
if (stat == -1) /* error? */
|
||||
return luaL_fileresult(L, 0, NULL);
|
||||
else {
|
||||
inspectstat(stat, what); /* interpret result */
|
||||
l_inspectstat(stat, what); /* interpret result */
|
||||
if (*what == 'e' && stat == 0) /* successful termination? */
|
||||
lua_pushboolean(L, 1);
|
||||
else
|
||||
|
|
8
liolib.c
8
liolib.c
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
** $Id: liolib.c,v 2.133 2014/10/17 16:28:21 roberto Exp roberto $
|
||||
** $Id: liolib.c,v 2.134 2014/10/17 19:17:55 roberto Exp roberto $
|
||||
** Standard I/O (and system) library
|
||||
** See Copyright Notice in lua.h
|
||||
*/
|
||||
|
@ -418,8 +418,8 @@ static int readdigits (RN *rn, int hex) {
|
|||
|
||||
|
||||
/* access to locale "radix character" (decimal point) */
|
||||
#if !defined(getlocaledecpoint)
|
||||
#define getlocaledecpoint() (localeconv()->decimal_point[0])
|
||||
#if !defined(l_getlocaledecpoint)
|
||||
#define l_getlocaledecpoint() (localeconv()->decimal_point[0])
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -434,7 +434,7 @@ static int read_number (lua_State *L, FILE *f) {
|
|||
int hex = 0;
|
||||
char decp[2] = ".";
|
||||
rn.f = f; rn.n = 0;
|
||||
decp[0] = getlocaledecpoint(); /* get decimal point from locale */
|
||||
decp[0] = l_getlocaledecpoint(); /* get decimal point from locale */
|
||||
l_lockfile(rn.f);
|
||||
do { rn.c = l_getc(rn.f); } while (isspace(rn.c)); /* skip spaces */
|
||||
test2(&rn, "-+"); /* optional signal */
|
||||
|
|
8
llex.c
8
llex.c
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
** $Id: llex.c,v 2.82 2014/10/10 22:23:04 roberto Exp roberto $
|
||||
** $Id: llex.c,v 2.83 2014/10/17 16:28:21 roberto Exp roberto $
|
||||
** Lexical Analyzer
|
||||
** See Copyright Notice in lua.h
|
||||
*/
|
||||
|
@ -218,8 +218,8 @@ static void buffreplace (LexState *ls, char from, char to) {
|
|||
}
|
||||
|
||||
|
||||
#if !defined(getlocaledecpoint)
|
||||
#define getlocaledecpoint() (localeconv()->decimal_point[0])
|
||||
#if !defined(l_getlocaledecpoint)
|
||||
#define l_getlocaledecpoint() (localeconv()->decimal_point[0])
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -231,7 +231,7 @@ static void buffreplace (LexState *ls, char from, char to) {
|
|||
*/
|
||||
static void trydecpoint (LexState *ls, TValue *o) {
|
||||
char old = ls->decpoint;
|
||||
ls->decpoint = getlocaledecpoint();
|
||||
ls->decpoint = l_getlocaledecpoint();
|
||||
buffreplace(ls, old, ls->decpoint); /* try new decimal separator */
|
||||
if (!buff2num(ls->buff, o)) {
|
||||
/* format error with correct decimal point: no more options */
|
||||
|
|
Loading…
Reference in New Issue