#define USE_WIN32_COMPAT_IO 1
extern void d_msg(const char *file, int line, int level, const char *fmt,...);
-#ifndef HAVE_MINGW
extern DWORD g_platform_id;
-#endif
// from CYGWIN (should be diff between Jan 1 1601 and Jan 1 1970
#ifdef HAVE_MINGW
char *tspec = (char *)malloc(max_len);
if (tspec == NULL) goto err1;
-#ifndef HAVE_MINGW
if (g_platform_id != VER_PLATFORM_WIN32_WINDOWS) {
// allow path to be 32767 bytes
tspec[0] = '\\';
} else {
cygwin_conv_to_win32_path(path, tspec);
}
-#else
- cygwin_conv_to_win32_path(path, tspec);
-#endif
+
strncat(tspec, "\\*", max_len);
rval->spec = tspec;
return _close(fd);
}
+#ifndef HAVE_WXCONSOLE
ssize_t
read(int fd, void *buf, size_t len)
{
{
return _write(fd, buf, len);
}
+#endif
off_t
lseek(int fd, off_t offset, int whence)
#define __COMPAT_H_
#ifndef HAVE_MINGW
+#ifndef HAVE_WXCONSOLE
#define __STDC__ 1
#endif
+#endif
#include <stdio.h>
#include <basetsd.h>
#include <stdarg.h>
#include <sys/types.h>
+#ifdef HAVE_WXCONSOLE
+//#include <sys/stat.h>
+#endif
+
#include <process.h>
#include <direct.h>
#include <winsock2.h>
#if __STDC__
#ifndef HAVE_MINGW
typedef _dev_t dev_t;
+#ifndef HAVE_WXCONSOLE
typedef __int64 ino_t;
typedef __int64 off_t; /* STDC=1 means we can define this */
#endif
+#endif
#else
typedef long _off_t; /* must be same as sys/types.h */
#endif
typedef signed char int8_t;
#ifndef HAVE_MINGW
+#ifndef HAVE_WXCONSOLE
typedef int BOOL;
#define bool BOOL
#endif
+#endif
typedef double float64_t;
typedef UINT32 u_int32_t;
typedef unsigned char u_int8_t;
#ifndef HAVE_MINGW
int utime(const char *filename, struct utimbuf *buf);
int open(const char *, int, int);
+#ifndef HAVE_WXCONSOLE
ssize_t read(int fd, void *, size_t nbytes);
ssize_t write(int fd, const void *, size_t nbytes);
+#endif
int close(int fd);
#endif //HAVE_MINGW
off_t lseek(int, off_t, int);