Sort all includes in src/gromacs
[alexxy/gromacs.git] / src / gromacs / gmxlib / checkpoint.cpp
index c2034ae93bd8a75f3a0dfa1cf27bc8297cea0b08..c1a806c42dc785c6bb80ba0fbc0c0b865bbe9b5c 100644 (file)
@@ -35,6 +35,8 @@
 
 /* The source code in this file should be thread-safe.
    Please keep it that way. */
+#include "gmxpre.h"
+
 #include "gromacs/legacyheaders/checkpoint.h"
 
 #include "config.h"
 #include <time.h>
 
 #include <fcntl.h>
+
 #ifdef HAVE_SYS_TIME_H
 #include <sys/time.h>
 #endif
-
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
-
 #ifdef GMX_NATIVE_WINDOWS
 /* _chsize_s */
 #include <io.h>
 #include <sys/locking.h>
 #endif
 
+#include "buildinfo.h"
+#include "gromacs/fileio/filenm.h"
+#include "gromacs/fileio/gmxfio.h"
+#include "gromacs/fileio/xdr_datatype.h"
+#include "gromacs/fileio/xdrf.h"
 #include "gromacs/legacyheaders/copyrite.h"
 #include "gromacs/legacyheaders/names.h"
+#include "gromacs/legacyheaders/network.h"
+#include "gromacs/legacyheaders/txtdump.h"
 #include "gromacs/legacyheaders/typedefs.h"
 #include "gromacs/legacyheaders/types/commrec.h"
-#include "gromacs/legacyheaders/txtdump.h"
 #include "gromacs/math/vec.h"
-#include "gromacs/legacyheaders/network.h"
-
-#include "gromacs/fileio/filenm.h"
-#include "gromacs/utility/futil.h"
-#include "gromacs/fileio/gmxfio.h"
-#include "gromacs/fileio/xdrf.h"
-#include "gromacs/fileio/xdr_datatype.h"
 #include "gromacs/utility/basenetwork.h"
 #include "gromacs/utility/baseversion.h"
 #include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
 
-#include "buildinfo.h"
-
 #ifdef GMX_FAHCORE
 #include "corewrap.h"
 #endif
@@ -175,7 +174,11 @@ gmx_wintruncate(const char *filename, __int64 size)
         return -1;
     }
 
+#ifdef _MSC_VER
     return _chsize_s( fileno(fp), size);
+#else
+    return _chsize( fileno(fp), size);
+#endif
 #endif
 }
 #endif