rename stat64_t definition to atStat64_t to avoid collisions

This commit is contained in:
Jack Andersen 2016-10-15 08:40:39 -10:00
parent a5a3244e1a
commit 2c23886134
4 changed files with 21 additions and 26 deletions

View File

@ -49,17 +49,15 @@
#ifdef GEKKO
#include "gekko_support.h"
typedef struct stat stat64_t;
#define stat64 stat
typedef struct stat atStat64_t;
#define atStat64 stat
#elif _WIN32
typedef struct _stat64 stat64_t;
#elif __FreeBSD__
typedef struct stat stat64_t;
#define stat64 stat
#define fseeko64 fseeko
#define ftello64 ftello
typedef struct _stat64 atStat64_t;
#elif __APPLE__ || __FreeBSD__
typedef struct stat atStat64_t;
#define atStat64 stat
#else
typedef struct stat64 stat64_t;
typedef struct stat64 atStat64_t;
#endif
#ifndef BLOCKSZ

View File

@ -14,7 +14,6 @@
#endif
#ifdef _MSC_VER
#define stat64 __stat64
#define realpath(__name, __resolved) _fullpath((__name), (__resolved), 4096)
#endif
@ -32,8 +31,8 @@ std::string Dir::absolutePath() const
bool Dir::isDir() const
{
stat64_t st;
int e = stat64(m_path.c_str(), &st);
atStat64_t st;
int e = atStat64(m_path.c_str(), &st);
if (e < 0)
return false;
@ -72,7 +71,7 @@ bool Dir::mkdir(const std::string& dir, mode_t mode)
{
#if _WIN32
return !(::_mkdir(dir.c_str()) < 0);
#else
#else
return !(::mkdir(dir.c_str(), mode) < 0);
#endif
}

View File

@ -26,7 +26,6 @@
#ifdef _MSC_VER
#include <functional>
#include <locale>
#define stat64 __stat64
#define realpath(__name, __resolved) _fullpath((__resolved), (__name), 4096)
#endif
@ -83,8 +82,8 @@ atUint64 FileInfo::size() const
bool FileInfo::exists() const
{
stat64_t st;
int e = stat64(m_path.c_str(), &st);
atStat64_t st;
int e = atStat64(m_path.c_str(), &st);
if (e < 0)
return false;
@ -94,8 +93,8 @@ bool FileInfo::exists() const
bool FileInfo::isLink() const
{
stat64_t st;
int e = stat64(m_path.c_str(), &st);
atStat64_t st;
int e = atStat64(m_path.c_str(), &st);
if (e < 0)
return false;
@ -104,8 +103,8 @@ bool FileInfo::isLink() const
bool FileInfo::isFile() const
{
stat64_t st;
int e = stat64(m_path.c_str(), &st);
atStat64_t st;
int e = atStat64(m_path.c_str(), &st);
if (e < 0)
return false;
@ -115,8 +114,8 @@ bool FileInfo::isFile() const
bool FileInfo::touch() const
{
#if defined(__GNUC__) && !(defined(HW_DOL) || defined(HW_RVL) || defined(GEKKO))
stat64_t st;
if (stat64(m_path.c_str(), &st) < 0) {
atStat64_t st;
if (atStat64(m_path.c_str(), &st) < 0) {
(void)athena::io::FileWriter(m_path);
return true;
}

View File

@ -15,7 +15,6 @@
#ifdef _MSC_VER
#include <functional>
#include <locale>
#define stat64 __stat64
#endif
namespace athena
@ -166,15 +165,15 @@ int countChar(const std::string& str, const char chr, int* lastOccur)
atUint64 fileSize(const std::string& filename)
{
stat64_t st;
stat64(filename.c_str(), &st);
atStat64_t st;
atStat64(filename.c_str(), &st);
return st.st_size;
}
#ifdef _MSC_VER
atUint64 fileSize(const std::wstring& filename)
{
stat64_t st;
atStat64_t st;
_wstati64(filename.c_str(), &st);
return st.st_size;
}