Skip to content

Commit

Permalink
Merge pull request #1000 from libcpr/fix/curl_progressfunc_continue_n…
Browse files Browse the repository at this point in the history
…ot_defined

Fixes #932 - `CURL_PROGRESSFUNC_CONTINUE` not always defined
  • Loading branch information
COM8 authored Dec 26, 2023
2 parents 98b8ab0 + f96b5db commit 3655ebd
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/cpr/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ size_t writeUserFunction(char* ptr, size_t size, size_t nmemb, const WriteCallba
template <typename T = ProgressCallback>
int progressUserFunction(const T* progress, cpr_pf_arg_t dltotal, cpr_pf_arg_t dlnow, cpr_pf_arg_t ultotal, cpr_pf_arg_t ulnow) {
const int cancel_retval{1};
#ifdef CURL_PROGRESSFUNC_CONTINUE // Not always defined. Ref: https://github.com/libcpr/cpr/issues/932
static_assert(cancel_retval != CURL_PROGRESSFUNC_CONTINUE);
#endif // CURL_PROGRESSFUNC_CONTINUE
return (*progress)(dltotal, dlnow, ultotal, ulnow) ? 0 : cancel_retval;
}
int debugUserFunction(CURL* handle, curl_infotype type, char* data, size_t size, const DebugCallback* debug);
Expand Down

0 comments on commit 3655ebd

Please sign in to comment.