Fossil SCM

fossil already provides compatibility wrappers for dirent and struct timeval

steveb 2011-11-07 07:07 jimtcl
Commit 5905232d4570632e8bdd27d091482744ff63461d
1 file changed +4
--- src/jim-win32compat.h
+++ src/jim-win32compat.h
@@ -34,18 +34,21 @@
3434
#define strtoull _strtoui64
3535
#define snprintf _snprintf
3636
3737
#include <io.h>
3838
39
+#ifndef NO_TIMEVAL
3940
struct timeval {
4041
long tv_sec;
4142
long tv_usec;
4243
};
44
+#endif
4345
4446
int gettimeofday(struct timeval *tv, void *unused);
4547
4648
#define HAVE_OPENDIR
49
+#ifndef NO_DIRENT
4750
struct dirent {
4851
char *d_name;
4952
};
5053
5154
typedef struct DIR {
@@ -56,10 +59,11 @@
5659
} DIR;
5760
5861
DIR *opendir(const char *name);
5962
int closedir(DIR *dir);
6063
struct dirent *readdir(DIR *dir);
64
+#endif
6165
#endif /* _MSC_VER */
6266
6367
#endif /* WIN32 */
6468
6569
#endif
6670
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button