From a29e816a9e9c116bb57e15d496befe97121aa077 Mon Sep 17 00:00:00 2001
From: James Graham <J.A.Graham@soton.ac.uk>
Date: Tue, 13 Oct 2015 10:20:00 +0100
Subject: [PATCH] Changed to fskipo from POSIX - requires gnu extensions with
 GCC, clang is fine

---
 CMakeLists.txt | 4 ++--
 xtc-length.c   | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5678b14..0967495 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,7 +1,7 @@
 project(xtc-length)
 
-if(CMAKE_VERSION VERSION_GREATER "3.1")
-    set(CMAKE_C_STANDARD 99)
+if("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
+    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu90")
 endif()
 
 add_executable(xtc-length xtc-length.c)
diff --git a/xtc-length.c b/xtc-length.c
index 8e14bca..ed28e1c 100644
--- a/xtc-length.c
+++ b/xtc-length.c
@@ -1,5 +1,5 @@
 #include <stdio.h>
-#include <inttypes.h>
+#include <stdint.h>
 #include <locale.h>
 #include <string.h>
 
@@ -33,7 +33,7 @@ int get_xtc_num_frames(const char *filename, int *nframes, int *natoms, float *p
         *natoms = u4_from_buffer(header+4);
         uint32_t frame_size = u4_from_buffer(header+88);    // Read frame size from header
         uint32_t skip = (frame_size+3) & ~((uint32_t)3);    // Round up to 4 bytes
-        fseek(xtc, skip, SEEK_CUR);                         // Skip to next header
+        fseeko(xtc, skip, SEEK_CUR);                         // Skip to next header
     }
     uint32_t ps_tmp = u4_from_buffer(header+12);
     memcpy(psec, &ps_tmp, 4);
-- 
GitLab