]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
Add missing compat.h header under src/client/
authorxndr <27174230+xndr@users.noreply.github.com>
Wed, 15 Oct 2025 18:41:57 +0000 (11:41 -0700)
committerVincent Bernat <vincent@bernat.ch>
Thu, 16 Oct 2025 02:15:36 +0000 (04:15 +0200)
Under certain conditions, build would fail due to a missing reference to
\#include "../compat/compat.h" in text_writer.c, kv_writer.c and
xml_writer.c.

example:
---------------
lldpd-1.0.20/src/client/text_writer.c:157:9: fatal error: call to undeclared function 'rpl_malloc'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
        priv = malloc(sizeof(*priv));
               ^
../../config.h:316:16: note: expanded from macro 'malloc'
\#define malloc rpl_malloc
               ^
1 error generated.
make[2]: *** [lldpcli-text_writer.o] Error 1
make[1]: *** [install-recursive] Error 1
make: *** [stamp-x86_64] Error 2
---------------
lldpd-1.0.20/src/client/kv_writer.c:41:19: fatal error: call to undeclared function 'rpl_malloc'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
        if ((newprefix = malloc(s + 1)) == NULL) fatal(NULL, NULL);
                         ^
../../config.h:316:16: note: expanded from macro 'malloc'
\#define malloc rpl_malloc
               ^
1 error generated.
make[2]: *** [lldpcli-kv_writer.o] Error 1
make[1]: *** [install-recursive] Error 1
make: *** [stamp-x86_64] Error 2
---------------
lldpd-1.0.20/src/client/xml_writer.c:139:9: fatal error: call to undeclared function 'rpl_malloc'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
        priv = malloc(sizeof(*priv));
               ^
../../config.h:316:16: note: expanded from macro 'malloc'
\#define malloc rpl_malloc
               ^
1 error generated.
make[2]: *** [lldpcli-xml_writer.o] Error 1
make[1]: *** [install-recursive] Error 1
make: *** [stamp-x86_64] Error 2

src/client/kv_writer.c
src/client/text_writer.c
src/client/xml_writer.c

index 56c9a431cdb4b05ebda8bd747c9739a15bdd6089..ed2fb27f0716b3919381c9421afed513230e425e 100644 (file)
@@ -21,6 +21,7 @@
 #include <string.h>
 
 #include "writer.h"
+#include "../compat/compat.h"
 #include "../log.h"
 
 #define SEP '.'
index 95990e749475d947197dd19c58cb8a345bcae51e..ddab693cab1638a527e76b07bd6c8f5c481cda18 100644 (file)
@@ -21,6 +21,7 @@
 #include <string.h>
 
 #include "writer.h"
+#include "../compat/compat.h"
 #include "../log.h"
 
 static char sep[] =
index 0c5efb554b8370771f1455141d84f7204d544345..befe7e01dc30adef86e647f6feefbfc8d562699f 100644 (file)
@@ -30,6 +30,7 @@
 #endif
 
 #include "writer.h"
+#include "../compat/compat.h"
 #include "../log.h"
 
 struct xml_writer_private {