> On 24 Oct 2023, at 13:55, Patrick Schlangen <[email protected]> wrote:
> 
> 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);
> }
> }
> 

Thanks a lot! That works, definitely will consider this one!

Cheers,

VL
-- 
Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-library
Etiquette:   https://curl.se/mail/etiquette.html

Reply via email to