]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/file.cpp
updated i18n sample, french translations are now in the "fr" subdirectory.
[wxWidgets.git] / src / common / file.cpp
index 30bc2d13d7e1e96dfc6ab2617ae8479b48f8b8d7..016c199ca16f93ca29cda0a84b2ff30de81be300 100644 (file)
@@ -53,6 +53,9 @@
   #include  <windows.h>     // for GetTempFileName
 #elif (defined(__UNIX__) || defined(__GNUWIN32__))
   #include  <unistd.h>
+#ifdef __GNUWIN32__
+  #include <windows.h>
+#endif
 #elif (defined(__WXSTUBS__))
   // Have to ifdef this for different environments
   #include <io.h>
@@ -298,12 +301,15 @@ size_t wxFile::Write(const void *pBuf, size_t nCount)
 bool wxFile::Flush()
 {
   if ( IsOpened() ) {
-               // @@@ fsync() is not ANSI (BSDish)
-//    if ( fsync(m_fd) == -1 ) { // TODO
-      if (wxTrue) {
-      wxLogSysError(_("can't flush file descriptor %d"), m_fd);
-      return FALSE;
-    }
+    #if defined(_MSC_VER) || wxHAVE_FSYNC
+        if ( fsync(m_fd) == -1 )
+        {
+            wxLogSysError(_("can't flush file descriptor %d"), m_fd);
+            return FALSE;
+        }
+    #else // no fsync
+        // just do nothing
+    #endif // fsync
   }
 
   return TRUE;