Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 1 | From 96233a8382b9520293a48b08dc3b204a21205800 Mon Sep 17 00:00:00 2001 |
| 2 | From: Wang Mingyu <wangmy@cn.fujitsu.com> |
| 3 | Date: Fri, 24 Apr 2020 00:53:19 +0900 |
| 4 | Subject: [PATCH] Fix bug of free() with musl |
| 5 | |
| 6 | This fixes build error with musl C library: |
| 7 | /ubinux-dev/ubinux001/contribution/build/tmp/work/armv7vet2hf-neon-poky-linux-musleabi/paho-mqtt-c/1.3.2-r0/git/src/Heap.h:55:24: |
| 8 | error: expected declaration specifiers or '...' before string constant |
| 9 | 55 | #define free(x) myfree(__FILE__, __LINE__, x) |
| 10 | | ^~~~~~~~ |
| 11 | /ubinux-dev/ubinux001/contribution/build/tmp/work/armv7vet2hf-neon-poky-linux-musleabi/paho-mqtt-c/1.3.2-r0/git/src/Heap.h:55:34: |
| 12 | error: expected declaration specifiers or '...' before numeric constant |
| 13 | 55 | #define free(x) myfree(__FILE__, __LINE__, x) |
| 14 | | ^~~~~~~~ |
| 15 | |
| 16 | Signed-off-by: Wang Mingyu <wangmy@cn.fujitsu.com> |
| 17 | --- |
| 18 | src/MQTTReasonCodes.c | 2 +- |
| 19 | 1 file changed, 1 insertion(+), 1 deletion(-) |
| 20 | |
| 21 | diff --git a/src/MQTTReasonCodes.c b/src/MQTTReasonCodes.c |
| 22 | index 416eab5..479dbac 100644 |
| 23 | --- a/src/MQTTReasonCodes.c |
| 24 | +++ b/src/MQTTReasonCodes.c |
| 25 | @@ -16,10 +16,10 @@ |
| 26 | |
| 27 | #include "MQTTReasonCodes.h" |
| 28 | |
| 29 | -#include "Heap.h" |
| 30 | #include "StackTrace.h" |
| 31 | |
| 32 | #include <memory.h> |
| 33 | +#include "Heap.h" |
| 34 | |
| 35 | #define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0])) |
| 36 | |
| 37 | -- |
| 38 | 2.17.1 |
| 39 | |