Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate with the existing boost asio #627

Open
codingl2k1 opened this issue Sep 10, 2024 · 2 comments
Open

Integrate with the existing boost asio #627

codingl2k1 opened this issue Sep 10, 2024 · 2 comments

Comments

@codingl2k1
Copy link

My project already has boost asio. However, I need to modify the source code of cinatra to integrate it with the existing boost asio. Is it possible to provide a macro or something to make this easier?

@qicosmos
Copy link
Owner

could you provide detail error messages?

@codingl2k1
Copy link
Author

For example,

cinatra/cinatra/coro_http_client.hpp:19:10: fatal error: 'asio/dispatch.hpp' file not found
#include "asio/dispatch.hpp"
         ^~~~~~~~~~~~~~~~~~~

I have to change it to #include <boost/asio/dispatch.hpp>.

Also, there are many compilation warnings when I compiles with clang:

cinatra/cinatra/multipart.hpp:28:12: error: unused variable 'last_size' [-Werror,-Wunused-variable]
    size_t last_size = chunked_buf_.size();
           ^
cinatra/cinatra/uri.hpp:280:7: error: 'sprintf' is deprecated: This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Werror,-Wdeprecated-declarations]
      sprintf(buf_hex, "%X", c);
      ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdio.h:180:1: note: 'sprintf' has been explicitly marked deprecated here
__deprecated_msg("This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:218:48: note: expanded from macro '__deprecated_msg'
        #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
                                                      ^

My clang version is:

Apple clang version 15.0.0 (clang-1500.3.9.4)
Target: arm64-apple-darwin23.5.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants