diff options
author | Rechi <Rechi@users.noreply.github.com> | 2019-02-01 12:30:51 +0100 |
---|---|---|
committer | Rechi <Rechi@users.noreply.github.com> | 2019-02-01 12:35:44 +0100 |
commit | f3c33d3d0de018feaa674fae289808530e4353aa (patch) | |
tree | 7bb70a12548b706516a7249e9e7aca51d652661f /tools/depends | |
parent | 339cc80afe5b1de9e6553ce6aba87b2bc1c845f6 (diff) |
[TexturePacker] update windows dirent implementation
Diffstat (limited to 'tools/depends')
-rw-r--r-- | tools/depends/native/TexturePacker/src/Win32/dirent.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/tools/depends/native/TexturePacker/src/Win32/dirent.c b/tools/depends/native/TexturePacker/src/Win32/dirent.c index 7b38291c6f..9d00cf0041 100644 --- a/tools/depends/native/TexturePacker/src/Win32/dirent.c +++ b/tools/depends/native/TexturePacker/src/Win32/dirent.c @@ -3,7 +3,7 @@ Implementation of POSIX directory browsing functions and types for Win32. Author: Kevlin Henney (kevlin@acm.org, kevlin@curbralan.com) - History: Created March 1997. Updated June 2003. + History: Created March 1997. Updated June 2003 and July 2012. Copyright Kevlin Henney, 1997, 2003. All rights reserved. @@ -28,9 +28,11 @@ extern "C" { #endif +typedef ptrdiff_t handle_type; /* C99's intptr_t not sufficiently portable */ + struct DIR { - long handle; /* -1 for failed rewind */ + handle_type handle; /* -1 for failed rewind */ struct _finddata_t info; struct dirent result; /* d_name null iff first time */ char *name; /* null-terminated char string */ @@ -51,7 +53,7 @@ DIR *opendir(const char *name) { strcat(strcpy(dir->name, name), all); - if((dir->handle = (long) _findfirst(dir->name, &dir->info)) != -1) + if ((dir->handle = (handle_type)_findfirst(dir->name, &dir->info)) != -1) { dir->result.d_name = 0; dir->result.d_type = 0; @@ -127,7 +129,7 @@ void rewinddir(DIR *dir) if(dir && dir->handle != -1) { _findclose(dir->handle); - dir->handle = (long) _findfirst(dir->name, &dir->info); + dir->handle = (handle_type)_findfirst(dir->name, &dir->info); dir->result.d_name = 0; dir->result.d_type = 0; } |