[Groonga-commit] groonga/groonga [master] use struct _stat and _stat() instead of struct __stat64 and _stat64() for MinGW. Thanks to Toshihisa Tashiro.

Back to archive index

null+****@clear***** null+****@clear*****
2012年 2月 23日 (木) 19:48:40 JST


Susumu Yata	2012-02-23 19:48:40 +0900 (Thu, 23 Feb 2012)

  New Revision: d46e426fc0df2dbeb8c281f170dc447461641b3c

  Log:
    use struct _stat and _stat() instead of struct __stat64 and _stat64() for MinGW. Thanks to Toshihisa Tashiro.

  Modified files:
    lib/dat/file-impl.cpp

  Modified: lib/dat/file-impl.cpp (+5 -0)
===================================================================
--- lib/dat/file-impl.cpp    2012-02-23 19:46:07 +0900 (b46a2f7)
+++ lib/dat/file-impl.cpp    2012-02-23 19:48:40 +0900 (b891cf5)
@@ -153,8 +153,13 @@ void FileImpl::create_(const char *path, UInt64 size) {
 }
 
 void FileImpl::open_(const char *path) {
+#ifdef _MSC_VER
   struct __stat64 st;
   GRN_DAT_THROW_IF(IO_ERROR, ::_stat64(path, &st) == -1);
+#else  // _MSC_VER
+  struct _stat st;
+  GRN_DAT_THROW_IF(IO_ERROR, ::_stat(path, &st) == -1);
+#endif  // _MSC_VER
   GRN_DAT_THROW_IF(IO_ERROR, st.st_size == 0);
   GRN_DAT_THROW_IF(IO_ERROR,
       static_cast<UInt64>(st.st_size) > std::numeric_limits< ::size_t>::max());




Groonga-commit メーリングリストの案内
Back to archive index