diff options
author | Dave Reisner <d@falconindy.com> | 2011-10-11 03:24:40 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2011-10-15 23:59:22 +0200 |
commit | 62bcf005f4678a93158358265ba905bace33b834 (patch) | |
tree | e769b0060be3b493402869cfa7728dbf8ffe4fd7 | |
parent | 1a416cd27a37dac23a36063ced06ecc99fcd41e2 (diff) |
typecheck: allow NULL to unset CURLOPT_ERRORBUFFER
There might be situations where a user would want to unset this option.
Avoid forcing him/her to cast the NULL argument to (char *) in order to
get past the compile time typecheck.
-rw-r--r-- | include/curl/typecheck-gcc.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/curl/typecheck-gcc.h b/include/curl/typecheck-gcc.h index 4e00ca9a4..5c584b002 100644 --- a/include/curl/typecheck-gcc.h +++ b/include/curl/typecheck-gcc.h @@ -392,7 +392,8 @@ _CURL_WARNING(_curl_easy_getinfo_err_curl_slist, /* evaluates to true if expr is abuffer suitable for CURLOPT_ERRORBUFFER */ /* XXX: also check size of an char[] array? */ #define _curl_is_error_buffer(expr) \ - (__builtin_types_compatible_p(__typeof__(expr), char *) || \ + (_curl_is_NULL(expr) || \ + __builtin_types_compatible_p(__typeof__(expr), char *) || \ __builtin_types_compatible_p(__typeof__(expr), char[])) /* evaluates to true if expr is of type (const) void* or (const) FILE* */ |