From 302111f89a08064628792f2663f8e6fcb577c0f4 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Sat, 2 Aug 2008 08:43:30 +0000 Subject: [PATCH] Bug 545954 - 64-bit issue in dirent 2008-08-02 Tor Lillqvist Bug 545954 - 64-bit issue in dirent * win32/dirent/dirent.h: Use __int64 for the dd_handle on 64-bit Windows. (Would use intptr_t, but that is not available before MSVS8, and we want to keep this compilable also with MSVS6 and 7, I think.) Thanks to Richard Hult. svn path=/trunk/; revision=7286 --- build/ChangeLog | 9 +++++++++ build/win32/dirent/dirent.h | 10 ++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/build/ChangeLog b/build/ChangeLog index bb4e9631..b6f06007 100644 --- a/build/ChangeLog +++ b/build/ChangeLog @@ -1,3 +1,12 @@ +2008-08-02 Tor Lillqvist + + Bug 545954 - 64-bit issue in dirent + + * win32/dirent/dirent.h: Use __int64 for the dd_handle on 64-bit + Windows. (Would use intptr_t, but that is not available before + MSVS8, and we want to keep this compilable also with MSVS6 and 7, + I think.) Thanks to Richard Hult. + 2008-05-19 Tor Lillqvist * win32/dirent/dirent.c: Include dirent.h with doublequotes so diff --git a/build/win32/dirent/dirent.h b/build/win32/dirent/dirent.h index e8ec7e0b..237665b4 100644 --- a/build/win32/dirent/dirent.h +++ b/build/win32/dirent/dirent.h @@ -25,6 +25,12 @@ struct dirent char d_name[FILENAME_MAX]; /* File name. */ }; +#ifdef _WIN64 +#define INTPTR __int64 +#else +#define INTPTR long +#endif + /* * This is an internal data structure. Good programmers will not use it * except as an argument to one of the functions below. @@ -41,7 +47,7 @@ typedef struct struct dirent dd_dir; /* _findnext handle */ - long dd_handle; + INTPTR dd_handle; /* * Status of search: @@ -88,7 +94,7 @@ typedef struct struct _wdirent dd_dir; /* _findnext handle */ - long dd_handle; + INTPTR dd_handle; /* * Status of search: -- 2.34.1