Skip to content

Commit

Permalink
Fixes #932
Browse files Browse the repository at this point in the history
Fixed CURL_PROGRESSFUNC_CONTINUE not always defined
  • Loading branch information
COM8 committed Dec 26, 2023
1 parent 561db4f commit f96b5db
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 f96b5db

Please sign in to comment.