summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/AbstractDiskWriter.cc2
-rw-r--r--src/File.cc12
-rw-r--r--src/File.h2
-rw-r--r--src/a2io.h2
4 files changed, 10 insertions, 8 deletions
diff --git a/src/AbstractDiskWriter.cc b/src/AbstractDiskWriter.cc
index afc3b7b7..11cb130b 100644
--- a/src/AbstractDiskWriter.cc
+++ b/src/AbstractDiskWriter.cc
@@ -168,7 +168,7 @@ uint64_t AbstractDiskWriter::size() const
if(fd == -1) {
throw DlAbortEx("File not opened.");
}
- struct stat fileStat;
+ a2_struct_stat fileStat;
if(fstat(fd, &fileStat) < 0) {
return 0;
}
diff --git a/src/File.cc b/src/File.cc
index 9bc57bf2..ed41b450 100644
--- a/src/File.cc
+++ b/src/File.cc
@@ -50,17 +50,17 @@ File::File(const std::string& name):name(name) {}
File::~File() {}
-int File::fillStat(struct stat& fstat) {
+int File::fillStat(a2_struct_stat& fstat) {
return stat(name.c_str(), &fstat);
}
bool File::exists() {
- struct stat fstat;
+ a2_struct_stat fstat;
return fillStat(fstat) == 0;
}
bool File::isFile() {
- struct stat fstat;
+ a2_struct_stat fstat;
if(fillStat(fstat) < 0) {
return false;
}
@@ -68,7 +68,7 @@ bool File::isFile() {
}
bool File::isDir() {
- struct stat fstat;
+ a2_struct_stat fstat;
if(fillStat(fstat) < 0) {
return false;
}
@@ -86,7 +86,7 @@ bool File::remove() {
}
uint64_t File::size() {
- struct stat fstat;
+ a2_struct_stat fstat;
if(fillStat(fstat) < 0) {
return 0;
}
@@ -122,7 +122,7 @@ bool File::mkdirs() {
mode_t File::mode()
{
- struct stat fstat;
+ a2_struct_stat fstat;
if(fillStat(fstat) < 0) {
return 0;
}
diff --git a/src/File.h b/src/File.h
index b7dac1d1..4a06ef0c 100644
--- a/src/File.h
+++ b/src/File.h
@@ -51,7 +51,7 @@ private:
/**
* Returns the return value of stat(...)
*/
- int fillStat(struct stat& fstat);
+ int fillStat(a2_struct_stat& fstat);
public:
File(const std::string& name);
~File();
diff --git a/src/a2io.h b/src/a2io.h
index 270f3fc7..6c3f4ef5 100644
--- a/src/a2io.h
+++ b/src/a2io.h
@@ -119,10 +119,12 @@
# ifdef stat
# undef stat
# endif // stat
+# define a2_struct_stat struct _stati64
# define stat(path, buf) _stati64(path, buf)
# define tell(handle) _telli64(handle)
# define a2mkdir(path, openMode) mkdir(path)
#else
+# define a2_struct_stat struct stat
# define a2mkdir(path, openMode) mkdir(path, openMode)
#endif // __MINGW32__