unify types

This commit is contained in:
Christien Rioux 2015-12-12 19:24:23 -08:00
parent 9394acb552
commit a57a2eed5b
2 changed files with 7 additions and 9 deletions

View File

@ -23,7 +23,6 @@
#define LCINVALIDHANDLE INVALID_HANDLE_VALUE #define LCINVALIDHANDLE INVALID_HANDLE_VALUE
#define LCSETREALLASTERROR(err, errstr) { setLastError((err), (errstr)); } #define LCSETREALLASTERROR(err, errstr) { setLastError((err), (errstr)); }
#define MAP_FAILED NULL #define MAP_FAILED NULL
typedef long long tlc_fileoffset_t;
#elif defined(TLC_COMPATIBLE_UNIX) #elif defined(TLC_COMPATIBLE_UNIX)
@ -34,17 +33,14 @@ typedef long long tlc_fileoffset_t;
#include<sys/mman.h> #include<sys/mman.h>
#if (defined (__APPLE__) && defined (__MACH__)) #if (defined (__APPLE__) && defined (__MACH__))
#include <sys/sysctl.h> #include <sys/sysctl.h>
typedef off_t tlc_fileoffset_t;
#define MMAP ::mmap #define MMAP ::mmap
#define FSTAT ::fstat #define FSTAT ::fstat
#define STAT ::stat #define STAT ::stat
#elif (defined(__linux__) || defined(__cygwin__)) && defined(_LARGEFILE64_SOURCE) #elif (defined(__linux__) || defined(__cygwin__)) && defined(_LARGEFILE64_SOURCE)
typedef off64_t tlc_fileoffset_t;
#define MMAP ::mmap64 #define MMAP ::mmap64
#define FSTAT ::fstat64 #define FSTAT ::fstat64
#define STAT ::stat64 #define STAT ::stat64
#else #else
typedef off_t tlc_fileoffset_t;
#define MMAP ::mmap #define MMAP ::mmap
#define FSTAT ::fstat #define FSTAT ::fstat
#define STAT ::stat #define STAT ::stat

View File

@ -70,7 +70,7 @@ BEGIN_TURBOLINECOUNT_NAMESPACE;
#endif #endif
typedef HANDLE tlc_filehandle_t; typedef HANDLE tlc_filehandle_t;
typedef long long tlc_fileoffset_t; typedef long long int tlc_fileoffset_t;
typedef tlc_fileoffset_t tlc_linecount_t; typedef tlc_fileoffset_t tlc_linecount_t;
#define TLC_LINECOUNT_FMT "%I64d" #define TLC_LINECOUNT_FMT "%I64d"
@ -78,6 +78,7 @@ BEGIN_TURBOLINECOUNT_NAMESPACE;
typedef std::string tlc_string_t; typedef std::string tlc_string_t;
typedef int tlc_filehandle_t; typedef int tlc_filehandle_t;
#if (defined (__APPLE__) && defined (__MACH__)) #if (defined (__APPLE__) && defined (__MACH__))
typedef off_t tlc_fileoffset_t; typedef off_t tlc_fileoffset_t;
#define TLC_LINECOUNT_FMT "%lld" #define TLC_LINECOUNT_FMT "%lld"
@ -92,6 +93,7 @@ BEGIN_TURBOLINECOUNT_NAMESPACE;
typedef off_t tlc_fileoffset_t; typedef off_t tlc_fileoffset_t;
#define TLC_LINECOUNT_FMT "%d" #define TLC_LINECOUNT_FMT "%d"
#endif #endif
typedef tlc_fileoffset_t tlc_linecount_t; typedef tlc_fileoffset_t tlc_linecount_t;
#endif #endif
@ -174,11 +176,11 @@ extern "C"
#endif #endif
#ifdef _WIN32 #ifdef _WIN32
long long turbo_linecount_handle(HANDLE fhandle, tlc_error_t * error = NULL, TCHAR ** errorstring = NULL); long long int turbo_linecount_handle(HANDLE fhandle, tlc_error_t * error = NULL, TCHAR ** errorstring = NULL);
long long turbo_linecount_file(const TCHAR *filename, tlc_error_t * error = NULL, TCHAR ** errorstring = NULL); long long int turbo_linecount_file(const TCHAR *filename, tlc_error_t * error = NULL, TCHAR ** errorstring = NULL);
#elif defined(TLC_COMPATIBLE_UNIX) #elif defined(TLC_COMPATIBLE_UNIX)
long long turbo_linecount_handle(int fhandle, tlc_error_t * tlc_error = NULL, char ** errorstring = NULL); long long int turbo_linecount_handle(int fhandle, tlc_error_t * tlc_error = NULL, char ** errorstring = NULL);
long long turbo_linecount_file(const char *filename, tlc_error_t * error = NULL, char ** errorstring = NULL); long long int turbo_linecount_file(const char *filename, tlc_error_t * error = NULL, char ** errorstring = NULL);
#endif #endif