Skip to content

Commit d5f9a76

Browse files
committed
libroxml: fix compilation with GCC14
Need casts for integer conversion Signed-off-by: Rosen Penev <rosenp@gmail.com>
1 parent 206752d commit d5f9a76

2 files changed

Lines changed: 32 additions & 1 deletion

File tree

libs/libroxml/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
99

1010
PKG_NAME:=libroxml
1111
PKG_VERSION:=3.0.2
12-
PKG_RELEASE:=2
12+
PKG_RELEASE:=3
1313

1414
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
1515
PKG_SOURCE_URL:=http://download.libroxml.net/pool/v3.x
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
--- a/src/roxml_mem.c
2+
+++ b/src/roxml_mem.c
3+
@@ -20,7 +20,7 @@ ROXML_STATIC ROXML_INT inline void roxml
4+
memory_cell_t *ptr = &head_cell;
5+
memory_cell_t *to_delete = NULL;
6+
7+
- while ((ptr->prev != NULL) && (ptr->prev->id != pthread_self()))
8+
+ while ((ptr->prev != NULL) && (ptr->prev->id != (unsigned long int)pthread_self()))
9+
ptr = ptr->prev;
10+
11+
if (ptr->prev == NULL)
12+
@@ -135,7 +135,7 @@ ROXML_INT void *roxml_malloc(int size, i
13+
cell->next->prev = cell;
14+
cell = cell->next;
15+
cell->type = type;
16+
- cell->id = pthread_self();
17+
+ cell->id = (unsigned long int)pthread_self();
18+
cell->occ = size;
19+
cell->ptr = calloc(num, size);
20+
head_cell.prev = cell;
21+
--- a/src/roxml_utils.h
22+
+++ b/src/roxml_utils.h
23+
@@ -48,7 +48,7 @@ ROXML_STATIC_INLINE ROXML_INT int roxml_
24+
#else /* CONFIG_XML_THREAD_SAFE==1 */
25+
ROXML_STATIC_INLINE ROXML_INT unsigned long int roxml_thread_id(node_t *n)
26+
{
27+
- return pthread_self();
28+
+ return (unsigned long int)pthread_self();
29+
}
30+
31+
ROXML_STATIC_INLINE ROXML_INT int roxml_lock_init(node_t *n)

0 commit comments

Comments
 (0)