aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2011-09-19 19:45:58 +0200
committerYang Tse <yangsita@gmail.com>2011-09-19 19:45:58 +0200
commit57119495daf2873f7396a718de3bfe97cdaa11e1 (patch)
treec93a66aedef82f37602081135dbd04c167fee488 /src
parentfdecb56cbfcafe5b770c4181133655b89973f41e (diff)
curl tool: fix compiler warning
Diffstat (limited to 'src')
-rw-r--r--src/tool_doswin.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/tool_doswin.c b/src/tool_doswin.c
index 2b900e161..f3ac21141 100644
--- a/src/tool_doswin.c
+++ b/src/tool_doswin.c
@@ -32,6 +32,33 @@
#include "memdebug.h" /* keep this as LAST include */
+/*
+ * Macros ALWAYS_TRUE and ALWAYS_FALSE are used to avoid compiler warnings.
+ */
+
+#define ALWAYS_TRUE (1)
+#define ALWAYS_FALSE (0)
+
+#if defined(_MSC_VER) && !defined(__POCC__)
+# undef ALWAYS_TRUE
+# undef ALWAYS_FALSE
+# if (_MSC_VER < 1500)
+# define ALWAYS_TRUE (0, 1)
+# define ALWAYS_FALSE (1, 0)
+# else
+# define ALWAYS_TRUE \
+__pragma(warning(push)) \
+__pragma(warning(disable:4127)) \
+(1) \
+__pragma(warning(pop))
+# define ALWAYS_FALSE \
+__pragma(warning(push)) \
+__pragma(warning(disable:4127)) \
+(0) \
+__pragma(warning(pop))
+# endif
+#endif
+
#ifdef WIN32
# undef PATH_MAX
# define PATH_MAX MAX_PATH