From 1ddfdc1a880279ce07b2c43f60b7aa138d4ad315 Mon Sep 17 00:00:00 2001 From: Benjamin Dobell Date: Mon, 17 Nov 2014 07:02:07 +1100 Subject: CMake files for Heimdall CLI and mingw support --- cmake/LargeFiles64.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 cmake/LargeFiles64.c (limited to 'cmake/LargeFiles64.c') diff --git a/cmake/LargeFiles64.c b/cmake/LargeFiles64.c new file mode 100644 index 0000000..57826b7 --- /dev/null +++ b/cmake/LargeFiles64.c @@ -0,0 +1,16 @@ +#include +#include +#include +#include + +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) +#define VALID_ARRAY_LENGTH 1 +#define INVALID_ARRAY_LENGTH -1 + +int main(int argc, const char **argv) +{ + int a[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? VALID_ARRAY_LENGTH : INVALID_ARRAY_LENGTH]; + off_t offset = ftello64(NULL); + fseeko64(NULL, offset, SEEK_SET); + return 0; +} -- cgit v1.1 From b9e722768f47d9118d594fba5cf00fc1c90ee862 Mon Sep 17 00:00:00 2001 From: Benjamin Dobell Date: Mon, 17 Nov 2014 16:06:06 +1100 Subject: CMake build fixes --- cmake/LargeFiles64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmake/LargeFiles64.c') diff --git a/cmake/LargeFiles64.c b/cmake/LargeFiles64.c index 57826b7..479993d 100644 --- a/cmake/LargeFiles64.c +++ b/cmake/LargeFiles64.c @@ -10,7 +10,7 @@ int main(int argc, const char **argv) { int a[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? VALID_ARRAY_LENGTH : INVALID_ARRAY_LENGTH]; - off_t offset = ftello64(NULL); + off64_t offset = ftello64(NULL); fseeko64(NULL, offset, SEEK_SET); return 0; } -- cgit v1.1