summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLua Team <team@lua.org>2007-03-28 12:00:00 +0000
committerrepogen <>2007-03-28 12:00:00 +0000
commit02f7e311361756dc5e8925659f06f35a011d530a (patch)
tree146f4f2fdffde2fe1da1f27aa3e2e7b6e9e9a0a2
parentd368f86a9d2a03bd5c3c0fae7f626ea8e2e6dc59 (diff)
downloadlua-github-02f7e311361756dc5e8925659f06f35a011d530a.tar.gz
Lua 5.1.2-rc45.1.2-rc4
-rw-r--r--etc/README3
-rw-r--r--etc/luavs.bat26
-rw-r--r--src/lfunc.c6
-rw-r--r--src/loadlib.c6
4 files changed, 27 insertions, 14 deletions
diff --git a/etc/README b/etc/README
index ad9ca6ab..dc29a45e 100644
--- a/etc/README
+++ b/etc/README
@@ -19,7 +19,8 @@ lua.pc
pkg-config data for Lua
luavs.bat
- Script to build Lua under "Visual Studio .NET Command Prompt".
+ Script to build Lua under "Visual Studio .NET Command Prompt",
+ contributed by Mike Pall. Run it from the toplevel as etc\luavs.bat.
min.c
A minimal Lua interpreter.
diff --git a/etc/luavs.bat b/etc/luavs.bat
index eea175e3..1b870de8 100644
--- a/etc/luavs.bat
+++ b/etc/luavs.bat
@@ -1,7 +1,19 @@
-cd src
-cl /O2 /W3 /c /DLUA_BUILD_AS_DLL l*.c
-del lua.obj luac.obj
-link /DLL /out:lua51.dll l*.obj
-cl /O2 /W3 /c /DLUA_BUILD_AS_DLL lua.c
-link /out:lua.exe lua.obj lua51.lib
-cd ..
+rem script to build Lua under "Visual Studio .NET Command Prompt".
+rem contributed by Mike Pall.
+
+rem do not run it from this directory, run it from the toplevel: etc\luavs.bat
+rem it creates lua51.dll, lua51.lib, lua.exe, and luac.exe in src.
+
+cd src
+cl /MD /O2 /W3 /c /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE /DLUA_BUILD_AS_DLL l*.c
+del lua.obj luac.obj
+link /DLL /out:lua51.dll l*.obj
+cl /MD /O2 /W3 /c /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE /DLUA_BUILD_AS_DLL lua.c
+link /out:lua.exe lua.obj lua51.lib
+cl /MD /O2 /W3 /c /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE l*.c print.c
+del lua.obj linit.obj lbaselib.obj ldblib.obj liolib.obj lmathlib.obj loslib.obj ltablib.obj lstrlib.obj loadlib.obj
+link /out:luac.exe *.obj
+del *.obj
+cd ..
+
+lauxlib.o
diff --git a/src/lfunc.c b/src/lfunc.c
index b8cd67b2..05bd5ff5 100644
--- a/src/lfunc.c
+++ b/src/lfunc.c
@@ -1,5 +1,5 @@
/*
-** $Id: lfunc.c,v 2.12 2005/12/22 16:19:56 roberto Exp $
+** $Id: lfunc.c,v 2.12a 2005/12/22 16:19:56 roberto Exp $
** Auxiliary functions to manipulate prototypes and closures
** See Copyright Notice in lua.h
*/
@@ -55,7 +55,7 @@ UpVal *luaF_findupval (lua_State *L, StkId level) {
GCObject **pp = &L->openupval;
UpVal *p;
UpVal *uv;
- while ((p = ngcotouv(*pp)) != NULL && p->v >= level) {
+ while (*pp != NULL && (p = ngcotouv(*pp))->v >= level) {
lua_assert(p->v != &p->u.value);
if (p->v == level) { /* found a corresponding upvalue? */
if (isdead(g, obj2gco(p))) /* is it dead? */
@@ -96,7 +96,7 @@ void luaF_freeupval (lua_State *L, UpVal *uv) {
void luaF_close (lua_State *L, StkId level) {
UpVal *uv;
global_State *g = G(L);
- while ((uv = ngcotouv(L->openupval)) != NULL && uv->v >= level) {
+ while (L->openupval != NULL && (uv = ngcotouv(L->openupval))->v >= level) {
GCObject *o = obj2gco(uv);
lua_assert(!isblack(o) && uv->v != &uv->u.value);
L->openupval = uv->next; /* remove from `open' list */
diff --git a/src/loadlib.c b/src/loadlib.c
index 767383df..808368ba 100644
--- a/src/loadlib.c
+++ b/src/loadlib.c
@@ -98,7 +98,7 @@ static void setprogdir (lua_State *L) {
char buff[MAX_PATH + 1];
char *lb;
DWORD nsize = sizeof(buff)/sizeof(char);
- DWORD n = GetModuleFileName(NULL, buff, nsize);
+ DWORD n = GetModuleFileNameA(NULL, buff, nsize);
if (n == 0 || n == nsize || (lb = strrchr(buff, '\\')) == NULL)
luaL_error(L, "unable to get ModuleFileName");
else {
@@ -112,7 +112,7 @@ static void setprogdir (lua_State *L) {
static void pusherror (lua_State *L) {
int error = GetLastError();
char buffer[128];
- if (FormatMessage(FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_FROM_SYSTEM,
+ if (FormatMessageA(FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_FROM_SYSTEM,
NULL, error, 0, buffer, sizeof(buffer), NULL))
lua_pushstring(L, buffer);
else
@@ -125,7 +125,7 @@ static void ll_unloadlib (void *lib) {
static void *ll_load (lua_State *L, const char *path) {
- HINSTANCE lib = LoadLibrary(path);
+ HINSTANCE lib = LoadLibraryA(path);
if (lib == NULL) pusherror(L);
return lib;
}