mirror of https://github.com/libAthena/athena.git
rename stat64_t definition to atStat64_t to avoid collisions
This commit is contained in:
parent
a5a3244e1a
commit
2c23886134
|
@ -49,17 +49,15 @@
|
||||||
|
|
||||||
#ifdef GEKKO
|
#ifdef GEKKO
|
||||||
#include "gekko_support.h"
|
#include "gekko_support.h"
|
||||||
typedef struct stat stat64_t;
|
typedef struct stat atStat64_t;
|
||||||
#define stat64 stat
|
#define atStat64 stat
|
||||||
#elif _WIN32
|
#elif _WIN32
|
||||||
typedef struct _stat64 stat64_t;
|
typedef struct _stat64 atStat64_t;
|
||||||
#elif __FreeBSD__
|
#elif __APPLE__ || __FreeBSD__
|
||||||
typedef struct stat stat64_t;
|
typedef struct stat atStat64_t;
|
||||||
#define stat64 stat
|
#define atStat64 stat
|
||||||
#define fseeko64 fseeko
|
|
||||||
#define ftello64 ftello
|
|
||||||
#else
|
#else
|
||||||
typedef struct stat64 stat64_t;
|
typedef struct stat64 atStat64_t;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef BLOCKSZ
|
#ifndef BLOCKSZ
|
||||||
|
|
|
@ -14,7 +14,6 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#define stat64 __stat64
|
|
||||||
#define realpath(__name, __resolved) _fullpath((__name), (__resolved), 4096)
|
#define realpath(__name, __resolved) _fullpath((__name), (__resolved), 4096)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -32,8 +31,8 @@ std::string Dir::absolutePath() const
|
||||||
|
|
||||||
bool Dir::isDir() const
|
bool Dir::isDir() const
|
||||||
{
|
{
|
||||||
stat64_t st;
|
atStat64_t st;
|
||||||
int e = stat64(m_path.c_str(), &st);
|
int e = atStat64(m_path.c_str(), &st);
|
||||||
if (e < 0)
|
if (e < 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,6 @@
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <locale>
|
#include <locale>
|
||||||
#define stat64 __stat64
|
|
||||||
#define realpath(__name, __resolved) _fullpath((__resolved), (__name), 4096)
|
#define realpath(__name, __resolved) _fullpath((__resolved), (__name), 4096)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -83,8 +82,8 @@ atUint64 FileInfo::size() const
|
||||||
|
|
||||||
bool FileInfo::exists() const
|
bool FileInfo::exists() const
|
||||||
{
|
{
|
||||||
stat64_t st;
|
atStat64_t st;
|
||||||
int e = stat64(m_path.c_str(), &st);
|
int e = atStat64(m_path.c_str(), &st);
|
||||||
|
|
||||||
if (e < 0)
|
if (e < 0)
|
||||||
return false;
|
return false;
|
||||||
|
@ -94,8 +93,8 @@ bool FileInfo::exists() const
|
||||||
|
|
||||||
bool FileInfo::isLink() const
|
bool FileInfo::isLink() const
|
||||||
{
|
{
|
||||||
stat64_t st;
|
atStat64_t st;
|
||||||
int e = stat64(m_path.c_str(), &st);
|
int e = atStat64(m_path.c_str(), &st);
|
||||||
if (e < 0)
|
if (e < 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
@ -104,8 +103,8 @@ bool FileInfo::isLink() const
|
||||||
|
|
||||||
bool FileInfo::isFile() const
|
bool FileInfo::isFile() const
|
||||||
{
|
{
|
||||||
stat64_t st;
|
atStat64_t st;
|
||||||
int e = stat64(m_path.c_str(), &st);
|
int e = atStat64(m_path.c_str(), &st);
|
||||||
if (e < 0)
|
if (e < 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
@ -115,8 +114,8 @@ bool FileInfo::isFile() const
|
||||||
bool FileInfo::touch() const
|
bool FileInfo::touch() const
|
||||||
{
|
{
|
||||||
#if defined(__GNUC__) && !(defined(HW_DOL) || defined(HW_RVL) || defined(GEKKO))
|
#if defined(__GNUC__) && !(defined(HW_DOL) || defined(HW_RVL) || defined(GEKKO))
|
||||||
stat64_t st;
|
atStat64_t st;
|
||||||
if (stat64(m_path.c_str(), &st) < 0) {
|
if (atStat64(m_path.c_str(), &st) < 0) {
|
||||||
(void)athena::io::FileWriter(m_path);
|
(void)athena::io::FileWriter(m_path);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,6 @@
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <locale>
|
#include <locale>
|
||||||
#define stat64 __stat64
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace athena
|
namespace athena
|
||||||
|
@ -166,15 +165,15 @@ int countChar(const std::string& str, const char chr, int* lastOccur)
|
||||||
|
|
||||||
atUint64 fileSize(const std::string& filename)
|
atUint64 fileSize(const std::string& filename)
|
||||||
{
|
{
|
||||||
stat64_t st;
|
atStat64_t st;
|
||||||
stat64(filename.c_str(), &st);
|
atStat64(filename.c_str(), &st);
|
||||||
return st.st_size;
|
return st.st_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
atUint64 fileSize(const std::wstring& filename)
|
atUint64 fileSize(const std::wstring& filename)
|
||||||
{
|
{
|
||||||
stat64_t st;
|
atStat64_t st;
|
||||||
_wstati64(filename.c_str(), &st);
|
_wstati64(filename.c_str(), &st);
|
||||||
return st.st_size;
|
return st.st_size;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue