Fossil SCM
fossil already provides compatibility wrappers for dirent and struct timeval
Commit
5905232d4570632e8bdd27d091482744ff63461d
Parent
b6270d665be938f…
1 file changed
+4
| --- src/jim-win32compat.h | ||
| +++ src/jim-win32compat.h | ||
| @@ -34,18 +34,21 @@ | ||
| 34 | 34 | #define strtoull _strtoui64 |
| 35 | 35 | #define snprintf _snprintf |
| 36 | 36 | |
| 37 | 37 | #include <io.h> |
| 38 | 38 | |
| 39 | +#ifndef NO_TIMEVAL | |
| 39 | 40 | struct timeval { |
| 40 | 41 | long tv_sec; |
| 41 | 42 | long tv_usec; |
| 42 | 43 | }; |
| 44 | +#endif | |
| 43 | 45 | |
| 44 | 46 | int gettimeofday(struct timeval *tv, void *unused); |
| 45 | 47 | |
| 46 | 48 | #define HAVE_OPENDIR |
| 49 | +#ifndef NO_DIRENT | |
| 47 | 50 | struct dirent { |
| 48 | 51 | char *d_name; |
| 49 | 52 | }; |
| 50 | 53 | |
| 51 | 54 | typedef struct DIR { |
| @@ -56,10 +59,11 @@ | ||
| 56 | 59 | } DIR; |
| 57 | 60 | |
| 58 | 61 | DIR *opendir(const char *name); |
| 59 | 62 | int closedir(DIR *dir); |
| 60 | 63 | struct dirent *readdir(DIR *dir); |
| 64 | +#endif | |
| 61 | 65 | #endif /* _MSC_VER */ |
| 62 | 66 | |
| 63 | 67 | #endif /* WIN32 */ |
| 64 | 68 | |
| 65 | 69 | #endif |
| 66 | 70 |
| --- src/jim-win32compat.h | |
| +++ src/jim-win32compat.h | |
| @@ -34,18 +34,21 @@ | |
| 34 | #define strtoull _strtoui64 |
| 35 | #define snprintf _snprintf |
| 36 | |
| 37 | #include <io.h> |
| 38 | |
| 39 | struct timeval { |
| 40 | long tv_sec; |
| 41 | long tv_usec; |
| 42 | }; |
| 43 | |
| 44 | int gettimeofday(struct timeval *tv, void *unused); |
| 45 | |
| 46 | #define HAVE_OPENDIR |
| 47 | struct dirent { |
| 48 | char *d_name; |
| 49 | }; |
| 50 | |
| 51 | typedef struct DIR { |
| @@ -56,10 +59,11 @@ | |
| 56 | } DIR; |
| 57 | |
| 58 | DIR *opendir(const char *name); |
| 59 | int closedir(DIR *dir); |
| 60 | struct dirent *readdir(DIR *dir); |
| 61 | #endif /* _MSC_VER */ |
| 62 | |
| 63 | #endif /* WIN32 */ |
| 64 | |
| 65 | #endif |
| 66 |
| --- src/jim-win32compat.h | |
| +++ src/jim-win32compat.h | |
| @@ -34,18 +34,21 @@ | |
| 34 | #define strtoull _strtoui64 |
| 35 | #define snprintf _snprintf |
| 36 | |
| 37 | #include <io.h> |
| 38 | |
| 39 | #ifndef NO_TIMEVAL |
| 40 | struct timeval { |
| 41 | long tv_sec; |
| 42 | long tv_usec; |
| 43 | }; |
| 44 | #endif |
| 45 | |
| 46 | int gettimeofday(struct timeval *tv, void *unused); |
| 47 | |
| 48 | #define HAVE_OPENDIR |
| 49 | #ifndef NO_DIRENT |
| 50 | struct dirent { |
| 51 | char *d_name; |
| 52 | }; |
| 53 | |
| 54 | typedef struct DIR { |
| @@ -56,10 +59,11 @@ | |
| 59 | } DIR; |
| 60 | |
| 61 | DIR *opendir(const char *name); |
| 62 | int closedir(DIR *dir); |
| 63 | struct dirent *readdir(DIR *dir); |
| 64 | #endif |
| 65 | #endif /* _MSC_VER */ |
| 66 | |
| 67 | #endif /* WIN32 */ |
| 68 | |
| 69 | #endif |
| 70 |