summaryrefslogtreecommitdiffstats
path: root/src/file_axx.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2015-04-11 14:23:16 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2015-04-11 14:23:16 +0200
commit67054372873f2ed5414da7fff1cb5744148289d6 (patch)
treea8cd9501bcfc1e1efec8ca6603e7f11b0ad2ec0c /src/file_axx.c
parentefc94ee87ac3b4e3ecf4fb3ab4adac2ef0a6278f (diff)
add gcc_struct attribute to all __packed__ structure
do not use fseeko() with mingw32 gcc compiler
Diffstat (limited to 'src/file_axx.c')
-rw-r--r--src/file_axx.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/file_axx.c b/src/file_axx.c
index 25cf767..72d1909 100644
--- a/src/file_axx.c
+++ b/src/file_axx.c
@@ -48,7 +48,12 @@ struct SHeader
{
uint32_t aoLength;
uint8_t oType;
-} __attribute__ ((__packed__));
+} __attribute__ ((gcc_struct, __packed__));
+#if defined(HAVE_FSEEKO) && !defined(__MINGW32__)
+#define my_fseek fseeko
+#else
+#define my_fseek fseek
+#endif
static void file_check_axx(file_recovery_t *fr)
{
@@ -57,11 +62,7 @@ static void file_check_axx(file_recovery_t *fr)
{
struct SHeader header;
unsigned int len;
-#ifdef HAVE_FSEEKO
- if(fseeko(fr->handle, offset, SEEK_SET) < 0)
-#else
- if(fseek(fr->handle, offset, SEEK_SET) < 0)
-#endif
+ if(my_fseek(fr->handle, offset, SEEK_SET) < 0)
return ;
if (fread(&header, sizeof(header), 1, fr->handle)!=1)
return ;