Skip to content

Commit

Permalink
Merge pull request #52 from thbeu/add-msvc-quick-fix-for-lfs
Browse files Browse the repository at this point in the history
Add MSVC quick fix for LFS
  • Loading branch information
rouault authored Oct 31, 2023
2 parents 0713692 + a874391 commit 0f3869f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
8 changes: 8 additions & 0 deletions safileio.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,20 @@ static SAOffset SADFWrite(void *p, SAOffset size, SAOffset nmemb, SAFile file)

static SAOffset SADFSeek(SAFile file, SAOffset offset, int whence)
{
#if defined(_MSC_VER) && _MSC_VER >= 1400
return (SAOffset)_fseeki64((FILE *)file, (__int64)offset, whence);
#else
return (SAOffset)fseek((FILE *)file, (long)offset, whence);
#endif
}

static SAOffset SADFTell(SAFile file)
{
#if defined(_MSC_VER) && _MSC_VER >= 1400
return (SAOffset)_ftelli64((FILE *)file);
#else
return (SAOffset)ftell((FILE *)file);
#endif
}

static int SADFFlush(SAFile file)
Expand Down
4 changes: 4 additions & 0 deletions shapefil.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,11 @@ extern "C"
typedef int *SAFile;

#ifndef SAOffset
#if defined(_MSC_VER) && _MSC_VER >= 1400
typedef unsigned __int64 SAOffset;
#else
typedef unsigned long SAOffset;
#endif
#endif

typedef struct
Expand Down

0 comments on commit 0f3869f

Please sign in to comment.