summaryrefslogtreecommitdiff
path: root/lib
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 /lib
parent6a37135f4d56e89a85db50a38b800fd49eeafe3a (diff)
downloadcurl-b2f430898053258622eebee3328f03441367a32c.tar.gz
Fix Pelles C Win32 target compilation issues
Diffstat (limited to 'lib')
-rw-r--r--lib/amigaos.c8
-rw-r--r--lib/config-win32.h66
-rw-r--r--lib/easy.c4
-rw-r--r--lib/nwlib.c8
-rw-r--r--lib/nwos.c8
-rw-r--r--lib/setup.h19
6 files changed, 79 insertions, 34 deletions
diff --git a/lib/amigaos.c b/lib/amigaos.c
index c7438a4eb..0e3445d81 100644
--- a/lib/amigaos.c
+++ b/lib/amigaos.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2007, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -72,4 +72,10 @@ BOOL amiga_init()
ADD2EXIT(amiga_cleanup,-50);
#endif
+#else /* __AMIGA__ */
+
+#ifdef __POCC__
+# pragma warn(disable:2024) /* Disable warning #2024: Empty input file */
+#endif
+
#endif /* __AMIGA__ */
diff --git a/lib/config-win32.h b/lib/config-win32.h
index dd81ee1f7..dbc44eec8 100644
--- a/lib/config-win32.h
+++ b/lib/config-win32.h
@@ -34,7 +34,7 @@
#define HAVE_LIMITS_H 1
/* Define if you need the malloc.h header file even with stdlib.h */
-#ifndef __SALFORDC__
+#if !defined(__SALFORDC__) && !defined(__POCC__)
#define NEED_MALLOC_H 1
#endif
@@ -82,7 +82,7 @@
/* Define if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1
-/* Define if you have the <sys/utime.h> header file */
+/* Define if you have the <sys/utime.h> header file. */
#ifndef __BORLANDC__
#define HAVE_SYS_UTIME_H 1
#endif
@@ -108,11 +108,13 @@
/* Define if you have the <winsock.h> header file. */
#define HAVE_WINSOCK_H 1
-#ifndef __SALFORDC__
/* Define if you have the <winsock2.h> header file. */
+#ifndef __SALFORDC__
#define HAVE_WINSOCK2_H 1
+#endif
/* Define if you have the <ws2tcpip.h> header file. */
+#ifndef __SALFORDC__
#define HAVE_WS2TCPIP_H 1
#endif
@@ -315,14 +317,16 @@
/* Define ssize_t if it is not an available 'typedefed' type */
#ifndef _SSIZE_T_DEFINED
-#if (defined(__WATCOMC__) && (__WATCOMC__ >= 1240)) || defined(__POCC__) || \
- defined(__MINGW32__)
-#elif defined(_WIN64)
-#define ssize_t __int64
-#else
-#define ssize_t int
-#endif
-#define _SSIZE_T_DEFINED
+# if (defined(__WATCOMC__) && (__WATCOMC__ >= 1240)) || \
+ defined(__POCC__) || \
+ defined(__MINGW32__)
+# elif defined(_WIN64)
+# define _SSIZE_T_DEFINED
+# define ssize_t __int64
+# else
+# define _SSIZE_T_DEFINED
+# define ssize_t int
+# endif
#endif
/* ---------------------------------------------------------------- */
@@ -437,11 +441,25 @@
# endif
#endif
+/* When no build target is specified Pelles C 5.00 and later default build
+ target is Windows Vista. We override default target to be Windows 2000. */
+#if defined(__POCC__) && (__POCC__ >= 500)
+# ifndef _WIN32_WINNT
+# define _WIN32_WINNT 0x0500
+# endif
+# ifndef WINVER
+# define WINVER 0x0500
+# endif
+#endif
+
/* Availability of freeaddrinfo, getaddrinfo and getnameinfo functions is
- quite convoluted, compiler dependant and in some cases even build target
- dependant. */
+ quite convoluted, compiler dependent and even build target dependent. */
#if defined(HAVE_WS2TCPIP_H)
-# if defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0501)
+# if defined(__POCC__)
+# define HAVE_FREEADDRINFO 1
+# define HAVE_GETADDRINFO 1
+# define HAVE_GETNAMEINFO 1
+# elif defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0501)
# define HAVE_FREEADDRINFO 1
# define HAVE_GETADDRINFO 1
# define HAVE_GETNAMEINFO 1
@@ -452,6 +470,15 @@
# endif
#endif
+#if defined(__POCC__)
+# ifndef _MSC_VER
+# error Microsoft extensions /Ze compiler option is required
+# endif
+# ifndef __POCC__OLDNAMES
+# error Compatibility names /Go compiler option is required
+# endif
+#endif
+
/* ---------------------------------------------------------------- */
/* LARGE FILE SUPPORT */
/* ---------------------------------------------------------------- */
@@ -468,6 +495,10 @@
# define USE_WIN32_LARGE_FILES
#endif
+#if defined(__POCC__)
+# undef USE_WIN32_LARGE_FILES
+#endif
+
#if !defined(USE_WIN32_LARGE_FILES) && !defined(USE_WIN32_SMALL_FILES)
# define USE_WIN32_SMALL_FILES
#endif
@@ -491,6 +522,10 @@
#define CURL_LDAP_WIN 1
#endif
+#if defined(__POCC__) && defined(CURL_LDAP_WIN)
+# define CURL_DISABLE_LDAP 1
+#endif
+
/* ---------------------------------------------------------------- */
/* ADDITIONAL DEFINITIONS */
/* ---------------------------------------------------------------- */
@@ -510,5 +545,8 @@
/* Name of package */
#define PACKAGE "curl"
+#if defined(__POCC__)
+# define ENABLE_IPV6 1
+#endif
#endif /* __LIB_CONFIG_WIN32_H */
diff --git a/lib/easy.c b/lib/easy.c
index ff808f9a5..0fee13f3e 100644
--- a/lib/easy.c
+++ b/lib/easy.c
@@ -206,7 +206,7 @@ static long init_flags;
#define system_strdup strdup
#endif
-#if defined(_MSC_VER) && defined(_DLL)
+#if defined(_MSC_VER) && defined(_DLL) && !defined(__POCC__)
# pragma warning(disable:4232) /* MSVC extension, dllimport identity */
#endif
@@ -232,7 +232,7 @@ curl_strdup_callback Curl_cstrdup;
curl_calloc_callback Curl_ccalloc;
#endif
-#if defined(_MSC_VER) && defined(_DLL)
+#if defined(_MSC_VER) && defined(_DLL) && !defined(__POCC__)
# pragma warning(default:4232) /* MSVC extension, dllimport identity */
#endif
diff --git a/lib/nwlib.c b/lib/nwlib.c
index 185042b29..cb1c5dd02 100644
--- a/lib/nwlib.c
+++ b/lib/nwlib.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -319,4 +319,10 @@ int main ( void )
#endif /* __NOVELL_LIBC__ */
+#else /* NETWARE */
+
+#ifdef __POCC__
+# pragma warn(disable:2024) /* Disable warning #2024: Empty input file */
+#endif
+
#endif /* NETWARE */
diff --git a/lib/nwos.c b/lib/nwos.c
index d9bfcf15e..399580c82 100644
--- a/lib/nwos.c
+++ b/lib/nwos.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2007, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -87,6 +87,10 @@ int __deinit_environment ( void )
#endif /* __NOVELL_LIBC__ */
-#endif /* NETWARE */
+#else /* NETWARE */
+#ifdef __POCC__
+# pragma warn(disable:2024) /* Disable warning #2024: Empty input file */
+#endif
+#endif /* NETWARE */
diff --git a/lib/setup.h b/lib/setup.h
index 7efc6104c..5f0de9050 100644
--- a/lib/setup.h
+++ b/lib/setup.h
@@ -255,19 +255,10 @@
#include <curl/stdcheaders.h>
#endif
-/*
- * PellesC kludge section (yikes);
- * - It has 'ssize_t', but it is in <unistd.h>. The way the headers
- * on Win32 are included, forces me to include this header here.
- * - sys_nerr, EINTR is missing in v4.0 or older.
- */
#ifdef __POCC__
- #include <sys/types.h>
- #include <unistd.h>
- #if (__POCC__ <= 400)
- #define sys_nerr EILSEQ /* for strerror.c */
- #define EINTR -1 /* for select.c */
- #endif
+# include <sys/types.h>
+# include <unistd.h>
+# define sys_nerr EILSEQ
#endif
/*
@@ -427,7 +418,7 @@
* are available if PSDK is properly installed.
*/
-#ifdef _MSC_VER
+#if defined(_MSC_VER) && !defined(__POCC__)
# if !defined(HAVE_WINSOCK2_H) || ((_MSC_VER < 1300) && !defined(IPPROTO_ESP))
# undef HAVE_STRUCT_SOCKADDR_STORAGE
# endif
@@ -438,7 +429,7 @@
* defined in ws2tcpip.h as well as to provide IPv6 support.
*/
-#ifdef _MSC_VER
+#if defined(_MSC_VER) && !defined(__POCC__)
# if !defined(HAVE_WS2TCPIP_H) || ((_MSC_VER < 1300) && !defined(INET6_ADDRSTRLEN))
# undef HAVE_FREEADDRINFO
# undef HAVE_GETADDRINFO