libroxml: fix compilation with GCC14
authorRosen Penev <rosenp@gmail.com>
Wed, 15 May 2024 04:16:43 +0000 (21:16 -0700)
committerRosen Penev <rosenp@gmail.com>
Thu, 16 May 2024 00:39:54 +0000 (17:39 -0700)
Need casts for integer conversion

Signed-off-by: Rosen Penev <rosenp@gmail.com>
libs/libroxml/Makefile
libs/libroxml/patches/020-gcc14.patch [new file with mode: 0644]

index a674f84cd5bd660e9d92f84f909de1ae0ca676e2..29bf986bf9be85a71304e6c32125fcf076d5eae4 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libroxml
 PKG_VERSION:=3.0.2
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://download.libroxml.net/pool/v3.x
diff --git a/libs/libroxml/patches/020-gcc14.patch b/libs/libroxml/patches/020-gcc14.patch
new file mode 100644 (file)
index 0000000..e20d75c
--- /dev/null
@@ -0,0 +1,31 @@
+--- a/src/roxml_mem.c
++++ b/src/roxml_mem.c
+@@ -20,7 +20,7 @@ ROXML_STATIC ROXML_INT inline void roxml
+       memory_cell_t *ptr = &head_cell;
+       memory_cell_t *to_delete = NULL;
+-      while ((ptr->prev != NULL) && (ptr->prev->id != pthread_self()))
++      while ((ptr->prev != NULL) && (ptr->prev->id != (unsigned long int)pthread_self()))
+               ptr = ptr->prev;
+       if (ptr->prev == NULL)
+@@ -135,7 +135,7 @@ ROXML_INT void *roxml_malloc(int size, i
+       cell->next->prev = cell;
+       cell = cell->next;
+       cell->type = type;
+-      cell->id = pthread_self();
++      cell->id = (unsigned long int)pthread_self();
+       cell->occ = size;
+       cell->ptr = calloc(num, size);
+       head_cell.prev = cell;
+--- a/src/roxml_utils.h
++++ b/src/roxml_utils.h
+@@ -48,7 +48,7 @@ ROXML_STATIC_INLINE ROXML_INT int roxml_
+ #else /* CONFIG_XML_THREAD_SAFE==1 */
+ ROXML_STATIC_INLINE ROXML_INT unsigned long int roxml_thread_id(node_t *n)
+ {
+-      return pthread_self();
++      return (unsigned long int)pthread_self();
+ }
+ ROXML_STATIC_INLINE ROXML_INT int roxml_lock_init(node_t *n)