libnopoll: Fix clashes with sys/param.h and link with openssl
authorFlorian Fainelli <f.fainelli@gmail.com>
Sun, 2 Jul 2017 19:57:08 +0000 (12:57 -0700)
committerFlorian Fainelli <f.fainelli@gmail.com>
Mon, 3 Jul 2017 03:51:17 +0000 (20:51 -0700)
Some toolchains may automatically have sys/params.h which includes
isset() backport upstream commit
675ac7b4b64d398de8a61e9c713383b8c0d9071f to fix that. Also explicitly
link with openssl.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
libs/libnopoll/Makefile
libs/libnopoll/patches/001-param_h_rename.patch [new file with mode: 0644]

index fe964055d1358174005be135d13f610130205aee..67940f09292ea70f4cdf76b771e3adf8544e3d75 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=nopoll
 PKG_VERSION:=0.4.2
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://github.com/ASPLes/nopoll.git
@@ -40,6 +40,8 @@ define Package/libnopoll/description
   This package contains the noPoll C WebSocket library.
 endef
 
+TARGET_LDFLAGS += -lcrypto -lpthread
+
 CONFIGURE_ARGS += \
        --enable-nopoll-log=no \
        --enable-nopoll-doc=no
diff --git a/libs/libnopoll/patches/001-param_h_rename.patch b/libs/libnopoll/patches/001-param_h_rename.patch
new file mode 100644 (file)
index 0000000..2eb0340
--- /dev/null
@@ -0,0 +1,66 @@
+From 675ac7b4b64d398de8a61e9c713383b8c0d9071f Mon Sep 17 00:00:00 2001
+From: Florian Fainelli <f.fainelli@gmail.com>
+Date: Tue, 20 Jun 2017 20:06:36 -0700
+Subject: [PATCH] nopoll: * [fix] Avoid clashes with isset() from sys/param.h
+
+---
+ src/nopoll_io.c      | 4 ++--
+ src/nopoll_loop.c    | 4 ++--
+ src/nopoll_private.h | 4 ++--
+ 3 files changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/src/nopoll_io.c b/src/nopoll_io.c
+index 036aa2c1c685..b3e48c2385d0 100644
+--- a/src/nopoll_io.c
++++ b/src/nopoll_io.c
+@@ -204,8 +204,8 @@ noPollIoEngine * nopoll_io_get_engine (noPollCtx * ctx, noPollIoEngineType engin
+       engine->destroy = nopoll_io_wait_select_destroy;
+       engine->clear   = nopoll_io_wait_select_clear;
+       engine->wait    = nopoll_io_wait_select_wait;
+-      engine->addto   = nopoll_io_wait_select_add_to;
+-      engine->isset   = nopoll_io_wait_select_is_set;
++      engine->add_to  = nopoll_io_wait_select_add_to;
++      engine->is_set  = nopoll_io_wait_select_is_set;
+       /* call to create the object */
+       engine->ctx       = ctx;
+diff --git a/src/nopoll_loop.c b/src/nopoll_loop.c
+index f58b8133b79a..60112f8dbf58 100644
+--- a/src/nopoll_loop.c
++++ b/src/nopoll_loop.c
+@@ -64,7 +64,7 @@ nopoll_bool nopoll_loop_register (noPollCtx * ctx, noPollConn * conn, noPollPtr
+       /* register the connection socket */
+       /* nopoll_log (ctx, NOPOLL_LEVEL_DEBUG, "Adding socket id: %d", conn->session);*/
+-      if (! ctx->io_engine->addto (conn->session, ctx, conn, ctx->io_engine->io_object)) {
++      if (! ctx->io_engine->add_to (conn->session, ctx, conn, ctx->io_engine->io_object)) {
+               /* remove this connection from registry */
+               nopoll_ctx_unregister_conn (ctx, conn);
+@@ -109,7 +109,7 @@ nopoll_bool nopoll_loop_process (noPollCtx * ctx, noPollConn * conn, noPollPtr u
+       int        * conn_changed = (int *) user_data;
+       /* check if the connection have something to notify */
+-      if (ctx->io_engine->isset (ctx, conn->session, ctx->io_engine->io_object)) {
++      if (ctx->io_engine->is_set (ctx, conn->session, ctx->io_engine->io_object)) {
+               /* call to notify action according to role */
+               switch (conn->role) {
+diff --git a/src/nopoll_private.h b/src/nopoll_private.h
+index 82fd27bb7fba..cd895d1e3ffd 100644
+--- a/src/nopoll_private.h
++++ b/src/nopoll_private.h
+@@ -340,8 +340,8 @@ struct _noPollIoEngine {
+       noPollIoMechDestroy    destroy;
+       noPollIoMechClear      clear;
+       noPollIoMechWait       wait;
+-      noPollIoMechAddTo      addto;
+-      noPollIoMechIsSet      isset;
++      noPollIoMechAddTo      add_to;
++      noPollIoMechIsSet      is_set;
+ };
+ struct _noPollMsg {
+-- 
+2.11.0
+