diff options
| author | Ramsay Jones <ramsay@ramsay1.demon.co.uk> | 2010-01-13 20:01:11 +0000 |
|---|---|---|
| committer | Ramsay Jones <ramsay@ramsay1.demon.co.uk> | 2010-01-20 20:16:34 +0000 |
| commit | e97179b6de293c8f288957dc556239a44fa52e3e (patch) | |
| tree | 4870103f0d85d833fafcac9f3eea8b17f9151125 /src/dir.h | |
| parent | 90d4d2f0fc362beabbbf76b4ffda0828229c198d (diff) | |
| download | libgit2-e97179b6de293c8f288957dc556239a44fa52e3e.tar.gz | |
win32: Add a 'git__' prefix to the directory reading routines
This reduces the global namespace pollution and allows for
a win32 compiler (eg. Open Watcom) to provide these routines
in a header other than <dirent.h> (eg in <io.h>).
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Diffstat (limited to 'src/dir.h')
| -rw-r--r-- | src/dir.h | 25 |
1 files changed, 17 insertions, 8 deletions
@@ -9,7 +9,7 @@ #ifdef GIT_WIN32 -struct dirent { +struct git__dirent { int d_ino; char d_name[261]; }; @@ -17,15 +17,24 @@ struct dirent { typedef struct { HANDLE h; WIN32_FIND_DATA f; - struct dirent entry; + struct git__dirent entry; char *dir; int first; -} DIR; - -extern DIR *opendir(const char *); -extern struct dirent *readdir(DIR *); -extern void rewinddir(DIR *); -extern int closedir(DIR *); +} git__DIR; + +extern git__DIR *git__opendir(const char *); +extern struct git__dirent *git__readdir(git__DIR *); +extern void git__rewinddir(git__DIR *); +extern int git__closedir(git__DIR *); + +# ifndef GIT__WIN32_NO_WRAP_DIR +# define dirent git__dirent +# define DIR git__DIR +# define opendir git__opendir +# define readdir git__readdir +# define rewinddir git__rewinddir +# define closedir git__closedir +# endif #endif |
