From 937afd1669637228b06bc29006c0d112b97c9314 Mon Sep 17 00:00:00 2001 From: Alex Hultman Date: Fri, 7 Jan 2022 03:47:23 +0100 Subject: [PATCH] Fix capi bug, add Makefile --- capi/App.cpp | 2 +- capi/Makefile | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 capi/Makefile diff --git a/capi/App.cpp b/capi/App.cpp index a38ab45..2b18ad9 100644 --- a/capi/App.cpp +++ b/capi/App.cpp @@ -21,7 +21,7 @@ extern "C" { void uws_res_end(uws_res_t *res, const char *data, size_t length) { uWS::HttpResponse *uwsRes = (uWS::HttpResponse *) res; - uwsRes->end(data, length); + uwsRes->end(std::string_view(data, length)); } void uws_app_listen(uws_app_t *app, int port, void (*handler)(void *)) { diff --git a/capi/Makefile b/capi/Makefile new file mode 100644 index 0000000..6ac53cd --- /dev/null +++ b/capi/Makefile @@ -0,0 +1,4 @@ +default: + make -C ../uSockets + g++ -O3 -std=c++17 -flto -DUWS_NO_ZLIB -I ../src -I ../uSockets/src App.cpp -c + gcc -O3 -flto example.c *.o -lstdc++ ../uSockets/uSockets.a -o example \ No newline at end of file