erofs-utils: lib: Explicitly include <pthread.h> where used
PATCH 1/1 erofs-utils: lib: Explicitly include <pthread.h> where used
compress.c and inode.c use pthread functions but do not explicitly include <pthread.h>. This causes build failures with the Android build system,
which throws "error: implicit declaration of function pthread_*".
Signed-off-by Satoshi Niwa <[email protected]>
--- lib/compress.c | 3 +++ lib/inode.c | 3 +++ 2 files changed, 6 insertions(+)
lib/compress.c +3 -0
@@ -8,6 +8,9 @@#ifndef _LARGEFILE64_SOURCE#define _LARGEFILE64_SOURCE#endif +#ifdef EROFS_MT_ENABLED +#include <pthread.h> +#endif #include <string.h> #include <stdlib.h> #include <unistd.h>
lib/inode.c +3 -0
@@ -6,6 +6,9 @@* with heavy changes by Gao Xiang <[email protected]> */ #define _GNU_SOURCE +#ifdef EROFS_MT_ENABLED +#include <pthread.h> +#endif #include <string.h> #include <stdlib.h> #include <stdio.h>
Signature · 1 line
2.47.0.rc0.187.ge670bccf7e-goog
Hi Satoshi,
Quoted 4 lines · Satoshi Niwa via Linux-erofs
compress.candinode.cuse pthread functions but do not explicitly include <pthread.h>. This causes build failures with the Android build system,
which throws "error: implicit declaration of function pthread_*".Quoted 1 line
Signed-off-by Satoshi Niwa <[email protected]>
Thanks for catching this!
Reviewed-by Gao Xiang <[email protected]>
Thanks,
Gao Xiang
Quoted 33 lines
--- lib/compress.c | 3 +++ lib/inode.c | 3 +++ 2 files changed, 6 insertions(+)lib/compress.c +3
-0@@ -8,6 +8,9 @@#ifndef _LARGEFILE64_SOURCE#define _LARGEFILE64_SOURCE#endif +#ifdef EROFS_MT_ENABLED +#include <pthread.h> +#endif #include <string.h> #include <stdlib.h> #include <unistd.h> lib/inode.c +3
-0@@ -6,6 +6,9 @@* with heavy changes by Gao Xiang <[email protected]> */ #define _GNU_SOURCE +#ifdef EROFS_MT_ENABLED +#include <pthread.h> +#endif #include <string.h> #include <stdlib.h> #include <stdio.h>