aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2009-10-27 16:38:42 +0000
committerYang Tse <yangsita@gmail.com>2009-10-27 16:38:42 +0000
commitb2f430898053258622eebee3328f03441367a32c (patch)
tree5edb80da68f40d6f5fda70da1fa73c907cc0f4e9 /src/main.c
parent6a37135f4d56e89a85db50a38b800fd49eeafe3a (diff)
Fix Pelles C Win32 target compilation issues
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c28
1 files changed, 21 insertions, 7 deletions
diff --git a/src/main.c b/src/main.c
index 4462b7d6e..fed1e1fcc 100644
--- a/src/main.c
+++ b/src/main.c
@@ -264,10 +264,12 @@ typedef enum {
#ifdef WIN32
# include <direct.h>
-# define F_OK 0
# define mkdir(x,y) (mkdir)(x)
# undef PATH_MAX
# define PATH_MAX MAX_PATH
+# ifndef __POCC__
+# define F_OK 0
+# endif
#endif
/*
@@ -407,18 +409,29 @@ char convert_char(curl_infotype infotype, char this_char)
#endif /* CURL_DOES_CONVERSIONS */
#ifdef WIN32
-/*
- * Truncate a file handle at a 64-bit position 'where'.
- * Borland doesn't even support 64-bit types.
- */
+
#ifdef __BORLANDC__
-#define _lseeki64(hnd,ofs,whence) lseek(hnd,ofs,whence)
+ /* 64-bit lseek-like function unavailable */
+# define _lseeki64(hnd,ofs,whence) lseek(hnd,ofs,whence)
+#endif
+
+#ifdef __POCC__
+# if (__POCC__ < 450)
+ /* 64-bit lseek-like function unavailable */
+# define _lseeki64(hnd,ofs,whence) _lseek(hnd,ofs,whence)
+# else
+# define _lseeki64(hnd,ofs,whence) _lseek64(hnd,ofs,whence)
+# endif
#endif
#ifndef HAVE_FTRUNCATE
#define HAVE_FTRUNCATE 1
#endif
+/*
+ * Truncate a file handle at a 64-bit position 'where'.
+ */
+
static int ftruncate64 (int fd, curl_off_t where)
{
if(_lseeki64(fd, where, SEEK_SET) < 0)
@@ -430,7 +443,8 @@ static int ftruncate64 (int fd, curl_off_t where)
return 0;
}
#define ftruncate(fd,where) ftruncate64(fd,where)
-#endif
+
+#endif /* WIN32 */
typedef enum {
TRACE_NONE, /* no trace/verbose output at all! */