Hi,
> Am 24.10.2023 um 12:24 schrieb Vladimir Levijev via curl-library
> <[email protected]>:
>
> So I tried it with #define but then you deal with static name of the error
> buffer and the GOTO label (in some parts we use it, but not everythere).
not exactly nice, but this might do the trick:
#define my_setopt(handle, option, ...) (last_option = #option,
curl_easy_setopt(handle, option, __VA_ARGS__))
void foo() {
const char *last_option = "none";
// ...
if (!my_setopt(e, CURLOPT_FOO, 123)) {
printf("Error in %s!\n", last_option);
}
}
Best,
Patrick
--
Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-library
Etiquette: https://curl.se/mail/etiquette.html