Merge pull request #441 from starkos/fix-vs-warning

Fix a new Visual Studio unused variable build warning
This commit is contained in:
Samuel Surtees 2016-03-02 00:25:17 +10:00
commit bf783483da

View File

@ -18,7 +18,6 @@ int os_isfile(lua_State* L)
int do_isfile(const char* filename) int do_isfile(const char* filename)
{ {
struct stat buf;
#if PLATFORM_WINDOWS #if PLATFORM_WINDOWS
DWORD attrib = GetFileAttributesA(filename); DWORD attrib = GetFileAttributesA(filename);
if (attrib != INVALID_FILE_ATTRIBUTES) if (attrib != INVALID_FILE_ATTRIBUTES)
@ -26,6 +25,7 @@ int do_isfile(const char* filename)
return (attrib & FILE_ATTRIBUTE_DIRECTORY) == 0; return (attrib & FILE_ATTRIBUTE_DIRECTORY) == 0;
} }
#else #else
struct stat buf;
if (stat(filename, &buf) == 0) if (stat(filename, &buf) == 0)
{ {
return ((buf.st_mode & S_IFDIR) == 0); return ((buf.st_mode & S_IFDIR) == 0);