From 79ffbf7fe1af3fb3d6a4a1ad31eeaaecb1dbd8e6 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Sun, 31 Aug 2008 12:12:35 +0000 Subject: MSVC adjustment --- docs/examples/10-at-a-time.c | 7 +++---- docs/examples/anyauthput.c | 17 +++++++++++++++-- docs/examples/fopen.c | 4 +++- docs/examples/ftpuploadresume.c | 3 +++ lib/easy.c | 8 ++++++++ 5 files changed, 32 insertions(+), 7 deletions(-) diff --git a/docs/examples/10-at-a-time.c b/docs/examples/10-at-a-time.c index 0b2a20ed8..13ff196c8 100644 --- a/docs/examples/10-at-a-time.c +++ b/docs/examples/10-at-a-time.c @@ -16,11 +16,10 @@ #include #include #include -#include -#include -#ifdef WIN32 -#include +#ifndef WIN32 +# include #endif +#include static const char *urls[] = { "http://www.microsoft.com", diff --git a/docs/examples/anyauthput.c b/docs/examples/anyauthput.c index 41531f7aa..11c9d3c77 100644 --- a/docs/examples/anyauthput.c +++ b/docs/examples/anyauthput.c @@ -9,10 +9,23 @@ */ #include -#include #include +#ifdef WIN32 +# include +#else +# include +# include +#endif +#include #include -#include + +#ifdef _MSC_VER +# ifdef _WIN64 + typedef __int64 intptr_t; +# else + typedef int intptr_t; +# endif +#endif #include diff --git a/docs/examples/fopen.c b/docs/examples/fopen.c index 9801e15c1..0a9e9e30d 100644 --- a/docs/examples/fopen.c +++ b/docs/examples/fopen.c @@ -45,7 +45,9 @@ #include #include -#include +#ifndef WIN32 +# include +#endif #include #include diff --git a/docs/examples/ftpuploadresume.c b/docs/examples/ftpuploadresume.c index d8d1c5b88..362711c33 100644 --- a/docs/examples/ftpuploadresume.c +++ b/docs/examples/ftpuploadresume.c @@ -21,6 +21,9 @@ #include +#if defined(_MSC_VER) && (_MSC_VER < 1300) +# error _snscanf requires MSVC 7.0 or later. +#endif /* The MinGW headers are missing a few Win32 function definitions, you shouldn't need this if you use VC++ */ diff --git a/lib/easy.c b/lib/easy.c index 0f6154448..d83a88511 100644 --- a/lib/easy.c +++ b/lib/easy.c @@ -205,6 +205,10 @@ static long init_flags; #define system_strdup strdup #endif +#if defined(_MSC_VER) && defined(_DLL) +# pragma warning(disable:4232) /* MSVC extension, dllimport identity */ +#endif + #ifndef __SYMBIAN32__ /* * If a memory-using function (like curl_getenv) is used before @@ -227,6 +231,10 @@ curl_strdup_callback Curl_cstrdup; curl_calloc_callback Curl_ccalloc; #endif +#if defined(_MSC_VER) && defined(_DLL) +# pragma warning(default:4232) /* MSVC extension, dllimport identity */ +#endif + /** * curl_global_init() globally initializes cURL given a bitwise set of the * different features of what to initialize. -- cgit v1.2.3