Bug 545954 - 64-bit issue in dirent
authorTor Lillqvist <tml@novell.com>
Sat, 2 Aug 2008 08:43:30 +0000 (08:43 +0000)
committerTor Lillqvist <tml@src.gnome.org>
Sat, 2 Aug 2008 08:43:30 +0000 (08:43 +0000)
2008-08-02  Tor Lillqvist  <tml@novell.com>

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
build/win32/dirent/dirent.h

index bb4e963..b6f0600 100644 (file)
@@ -1,3 +1,12 @@
+2008-08-02  Tor Lillqvist  <tml@novell.com>
+
+       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  <tml@novell.com>
 
        * win32/dirent/dirent.c: Include dirent.h with doublequotes so
index e8ec7e0..237665b 100644 (file)
@@ -25,6 +25,12 @@ struct dirent
        char            d_name[FILENAME_MAX]; /* File name. */\r
 };\r
 \r
+#ifdef _WIN64\r
+#define INTPTR __int64\r
+#else\r
+#define INTPTR long\r
+#endif\r
+\r
 /*\r
  * This is an internal data structure. Good programmers will not use it\r
  * except as an argument to one of the functions below.\r
@@ -41,7 +47,7 @@ typedef struct
        struct dirent           dd_dir;\r
 \r
        /* _findnext handle */\r
-       long                    dd_handle;\r
+       INTPTR                  dd_handle;\r
 \r
        /*\r
          * Status of search:\r
@@ -88,7 +94,7 @@ typedef struct
        struct _wdirent         dd_dir;\r
 \r
        /* _findnext handle */\r
-       long                    dd_handle;\r
+       INTPTR                  dd_handle;\r
 \r
        /*\r
          * Status of search:\r