Signed-off-by: Zang Ruochen <[email protected]>
---
 .../0001-Fix-build-with-libmicrohttpd.patch   | 52 +++++++++++++++++++
 .../recipes-devtools/jsonrpc/jsonrpc_1.3.0.bb |  5 +-
 2 files changed, 56 insertions(+), 1 deletion(-)
 create mode 100644 
meta-oe/recipes-devtools/jsonrpc/jsonrpc/0001-Fix-build-with-libmicrohttpd.patch

diff --git 
a/meta-oe/recipes-devtools/jsonrpc/jsonrpc/0001-Fix-build-with-libmicrohttpd.patch
 
b/meta-oe/recipes-devtools/jsonrpc/jsonrpc/0001-Fix-build-with-libmicrohttpd.patch
new file mode 100644
index 0000000000..a4cacb3fc0
--- /dev/null
+++ 
b/meta-oe/recipes-devtools/jsonrpc/jsonrpc/0001-Fix-build-with-libmicrohttpd.patch
@@ -0,0 +1,52 @@
+From d983161415f5f5748fbdbaa5fbd168154ccf8867 Mon Sep 17 00:00:00 2001
+From: Zang Ruochen <[email protected]>
+Date: Wed, 5 Aug 2020 12:31:24 +0900
+Subject: [PATCH] Fix build with libmicrohttpd 0.9.71
+
+---
+ src/jsonrpccpp/server/connectors/httpserver.cpp | 2 +-
+ src/jsonrpccpp/server/connectors/httpserver.h   | 8 +++++++-
+ 2 files changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/src/jsonrpccpp/server/connectors/httpserver.cpp 
b/src/jsonrpccpp/server/connectors/httpserver.cpp
+index a849615..dd3b841 100644
+--- a/src/jsonrpccpp/server/connectors/httpserver.cpp
++++ b/src/jsonrpccpp/server/connectors/httpserver.cpp
+@@ -151,7 +151,7 @@ void HttpServer::SetUrlHandler(const string &url,
+   this->SetHandler(NULL);
+ }
+ 
+-int HttpServer::callback(void *cls, MHD_Connection *connection, const char 
*url,
++mhd_result HttpServer::callback(void *cls, MHD_Connection *connection, const 
char *url,
+                          const char *method, const char *version,
+                          const char *upload_data, size_t *upload_data_size,
+                          void **con_cls) {
+diff --git a/src/jsonrpccpp/server/connectors/httpserver.h 
b/src/jsonrpccpp/server/connectors/httpserver.h
+index 7785edb..0dcf032 100644
+--- a/src/jsonrpccpp/server/connectors/httpserver.h
++++ b/src/jsonrpccpp/server/connectors/httpserver.h
+@@ -32,6 +32,12 @@ typedef intptr_t ssize_t;
+ #include <map>
+ #include <microhttpd.h>
+ 
++#if MHD_VERSION >= 0x00097002
++#  define mhd_result enum MHD_Result
++#else
++#  define mhd_result int
++#endif
++
+ namespace jsonrpc {
+ /**
+  * This class provides an embedded HTTP Server, based on libmicrohttpd, to
+@@ -79,7 +85,7 @@ private:
+   std::map<std::string, IClientConnectionHandler *> urlhandler;
+   struct sockaddr_in loopback_addr;
+ 
+-  static int callback(void *cls, struct MHD_Connection *connection,
++  static mhd_result callback(void *cls, struct MHD_Connection *connection,
+                       const char *url, const char *method, const char 
*version,
+                       const char *upload_data, size_t *upload_data_size,
+                       void **con_cls);
+-- 
+2.25.1
+
diff --git a/meta-oe/recipes-devtools/jsonrpc/jsonrpc_1.3.0.bb 
b/meta-oe/recipes-devtools/jsonrpc/jsonrpc_1.3.0.bb
index ca9675ed64..0ae39765f2 100644
--- a/meta-oe/recipes-devtools/jsonrpc/jsonrpc_1.3.0.bb
+++ b/meta-oe/recipes-devtools/jsonrpc/jsonrpc_1.3.0.bb
@@ -9,7 +9,10 @@ SECTION = "libs"
 
 DEPENDS = "curl jsoncpp libmicrohttpd hiredis"
 
-SRC_URI = "git://github.com/cinemast/libjson-rpc-cpp"
+SRC_URI = "git://github.com/cinemast/libjson-rpc-cpp \
+          file://0001-Fix-build-with-libmicrohttpd.patch \
+"
+
 SRCREV = "c696f6932113b81cd20cd4a34fdb1808e773f23e"
 
 S = "${WORKDIR}/git"
-- 
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#86158): 
https://lists.openembedded.org/g/openembedded-devel/message/86158
Mute This Topic: https://lists.openembedded.org/mt/76002081/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub  
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to