#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>
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;