From 90eae7175ca5e9f36a228314a88098d046608595 Mon Sep 17 00:00:00 2001 From: David Mayerich Date: Thu, 1 Dec 2016 12:27:40 -0600 Subject: [PATCH] added filesize check for GCC --- stim/util/filesize.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/stim/util/filesize.h b/stim/util/filesize.h index 273fe8b..c053f71 100644 --- a/stim/util/filesize.h +++ b/stim/util/filesize.h @@ -3,6 +3,9 @@ #ifdef _WIN32 #include +#else +#include +#include #endif namespace stim{ @@ -17,10 +20,10 @@ static size_t file_size(std::string filename){ } CloseHandle(hFile); return (size_t)size.QuadPart; -#elif - - - +#else + struct stat sb; + stat(filename.c_str(), &sb); + return sb.st_size; #endif } @@ -28,4 +31,4 @@ static size_t file_size(std::string filename){ -#endif \ No newline at end of file +#endif -- libgit2 0.21.4