summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/tool_doswin.c31
-rw-r--r--src/tool_easysrc.c2
-rw-r--r--src/tool_getparam.c2
-rw-r--r--src/tool_metalink.c2
-rw-r--r--src/tool_setopt.c6
-rw-r--r--src/tool_setopt.h2
6 files changed, 9 insertions, 36 deletions
diff --git a/src/tool_doswin.c b/src/tool_doswin.c
index 779a3cb8f..a64a81633 100644
--- a/src/tool_doswin.c
+++ b/src/tool_doswin.c
@@ -38,33 +38,6 @@
#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
@@ -79,9 +52,9 @@ __pragma(warning(pop))
#endif
#ifdef WIN32
-# define _use_lfn(f) ALWAYS_TRUE /* long file names always available */
+# define _use_lfn(f) (1) /* long file names always available */
#elif !defined(__DJGPP__) || (__DJGPP__ < 2) /* DJGPP 2.0 has _use_lfn() */
-# define _use_lfn(f) ALWAYS_FALSE /* long file names never available */
+# define _use_lfn(f) (0) /* long file names never available */
#elif defined(__DJGPP__)
# include <fcntl.h> /* _use_lfn(f) prototype */
#endif
diff --git a/src/tool_easysrc.c b/src/tool_easysrc.c
index cb30e404b..87ad4bbaa 100644
--- a/src/tool_easysrc.c
+++ b/src/tool_easysrc.c
@@ -123,7 +123,7 @@ CURLcode easysrc_addf(struct slist_wc **plist, const char *fmt, ...)
return ret;
}
-#define CHKRET(v) do {CURLcode ret = (v); if(ret) return ret;} WHILE_FALSE
+#define CHKRET(v) do {CURLcode ret = (v); if(ret) return ret;} while(0)
CURLcode easysrc_init(void)
{
diff --git a/src/tool_getparam.c b/src/tool_getparam.c
index 3efc23e1e..a7bcdafac 100644
--- a/src/tool_getparam.c
+++ b/src/tool_getparam.c
@@ -58,7 +58,7 @@
if(!(*(str))) \
return PARAM_NO_MEM; \
} \
-} WHILE_FALSE
+} while(0)
struct LongShort {
const char *letter; /* short name option */
diff --git a/src/tool_metalink.c b/src/tool_metalink.c
index 889da4bff..6d62f2d93 100644
--- a/src/tool_metalink.c
+++ b/src/tool_metalink.c
@@ -119,7 +119,7 @@ struct win32_crypto_hash {
*(str) = strdup((val)); \
if(!(val)) \
return PARAM_NO_MEM; \
-} WHILE_FALSE
+} while(0)
#if defined(USE_OPENSSL)
/* Functions are already defined */
diff --git a/src/tool_setopt.c b/src/tool_setopt.c
index 4c98d9057..e56af1317 100644
--- a/src/tool_setopt.c
+++ b/src/tool_setopt.c
@@ -181,18 +181,18 @@ static const NameValue setopt_nv_CURLNONZERODEFAULTS[] = {
ret = easysrc_add args; \
if(ret) \
goto nomem; \
-} WHILE_FALSE
+} while(0)
#define ADDF(args) do { \
ret = easysrc_addf args; \
if(ret) \
goto nomem; \
-} WHILE_FALSE
+} while(0)
#define NULL_CHECK(p) do { \
if(!p) { \
ret = CURLE_OUT_OF_MEMORY; \
goto nomem; \
} \
-} WHILE_FALSE
+} while(0)
#define DECL0(s) ADD((&easysrc_decl, s))
#define DECL1(f,a) ADDF((&easysrc_decl, f,a))
diff --git a/src/tool_setopt.h b/src/tool_setopt.h
index 63401337f..48e9e818d 100644
--- a/src/tool_setopt.h
+++ b/src/tool_setopt.h
@@ -35,7 +35,7 @@
if(result) \
break; \
} \
- } WHILE_FALSE
+ } while(0)
/* allow removed features to simulate success: */
bool tool_setopt_skip(CURLoption tag);