jpbarrette/curlpp

Compile issue on openSuse

Opened this issue · 1 comments

When building this error pops up:

Options.hpp:281:74: error: invalid conversion from ‘int’ to ‘CURLoption’ [-fpermissive]
281 | typedef curlpp::OptionTrait<curl_closepolicy, CURLOPT_CLOSEPOLICY> ClosePolicy;
| ^
| |
| int

I get the same error on Windows/MSVC/clang-cl too:

../../include\curlpp/Options.hpp(311,48): error: value of type 'int' is not implicitly convertible to 'CURLoption'
  311 |         typedef curlpp::OptionTrait<curl_closepolicy, CURLOPT_CLOSEPOLICY> ClosePolicy;
      |                                                       ^~~~~~~~~~~~~~~~~~~
../../../include\curl/curl.h(719,29): note: expanded from macro 'CURLOPT_CLOSEPOLICY'
  719 | #define CURLOPT_CLOSEPOLICY CURLOPT_OBSOLETE72
      |                             ^~~~~~~~~~~~~~~~~~
../../../include\curl/curl.h(720,28): note: expanded from macro 'CURLOPT_OBSOLETE72'
  720 | #define CURLOPT_OBSOLETE72 9999
      |                            ^~~~

Which I fixed by:

--- a/include/curlpp/Options.hpp 2024-06-01 06:49:19
+++ b/include/curlpp/Options.hpp 2024-11-11 11:20:30
@@ -308,7 +308,9 @@
        typedef curlpp::OptionTrait<long, CURLOPT_LOW_SPEED_LIMIT> LowSpeedLimit;
        typedef curlpp::OptionTrait<long, CURLOPT_LOW_SPEED_TIME> LowSpeedTime;
        typedef curlpp::OptionTrait<long, CURLOPT_MAXCONNECTS> MaxConnects;
+#if LIBCURL_VERSION_NUM < 0x071001
        typedef curlpp::OptionTrait<curl_closepolicy, CURLOPT_CLOSEPOLICY> ClosePolicy;
+#endif
        typedef curlpp::OptionTrait<bool, CURLOPT_FRESH_CONNECT> FreshConnect;
        typedef curlpp::OptionTrait<bool, CURLOPT_FORBID_REUSE> ForbidReuse;
        typedef curlpp::OptionTrait<long, CURLOPT_CONNECTTIMEOUT> ConnectTimeout;

I've no idea if it's correct.