summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2008-03-11 13:14:16 +0000
committerDaniel Stenberg <daniel@haxx.se>2008-03-11 13:14:16 +0000
commitecf1c6ca5daf0bb8bb5a77167dff8f56cc89417f (patch)
tree210c31869737c55cdadf21be92ddebc367b36191 /include
parent9b48991ebd855efaeefc2a64c3e818465751db6a (diff)
downloadcurl-ecf1c6ca5daf0bb8bb5a77167dff8f56cc89417f.tar.gz
- Added a macro for curl_easy_setopt() that accepts three arguments and simply
does nothing with them, just to make sure libcurl users always use three arguments to this function. Due to its use of ... for the third argument, it is otherwise hard to detect abuse.
Diffstat (limited to 'include')
-rw-r--r--include/curl/curl.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/include/curl/curl.h b/include/curl/curl.h
index 3027ca06d..4af714291 100644
--- a/include/curl/curl.h
+++ b/include/curl/curl.h
@@ -1792,8 +1792,16 @@ CURL_EXTERN CURLcode curl_easy_pause(CURL *handle, int bitmask);
#include "multi.h"
/* the typechecker doesn't work in C++ (yet) */
-#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) && !defined(__cplusplus)
+#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) && \
+ !defined(__cplusplus)
#include "typecheck-gcc.h"
+#else
+#if defined(__STDC__) && (__STDC__ >= 1)
+/* This preprocessor magic that replaces a call with the exact same call is
+ only done to make sure application authors use exactly three arguments
+ to this function. */
+#define curl_easy_setopt(handle,opt,param) curl_easy_setopt(handle,opt,param)
+#endif /* __STDC__ >= 1 */
#endif /* gcc >= 4.3 && !__cplusplus */
#endif /* __CURL_CURL_H */