Skip to contentSkip to conversation

erofs-utils: avoid _LARGEFILE64_SOURCE and _GNU_SOURCE redefinition

PATCH In review Gao Xiang via Linux-erofs 2 participants 3 messages Mar 14, 2020 – Mar 27, 2020 1 message not in the archive Library code

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/1 erofs-utils: avoid _LARGEFILE64_SOURCE and _GNU_SOURCE redefinition

From: Gao Xiang <[email protected]>

This patch can be used to resolve the following build errors:

compress.c:10: error: "_LARGEFILE64_SOURCE" redefined [-Werror]
#define _LARGEFILE64_SOURCE

<command-line>: note: this is the location of the previous definition

io.c:9: error: "_LARGEFILE64_SOURCE" redefined [-Werror]
#define _LARGEFILE64_SOURCE

<command-line>: note: this is the location of the previous definition

---
 lib/compress.c | 2 ++
 lib/io.c       | 4 ++++
 2 files changed, 6 insertions(+)
lib/compress.c +2 -0
index 8337487..b14ff17 100644
@@ -7,7 +7,9 @@
  * Created by Miao Xie <[email protected]>
  * with heavy changes by Gao Xiang <[email protected]>
  */
+#ifndef _LARGEFILE64_SOURCE
 #define _LARGEFILE64_SOURCE
+#endif
 #include <string.h>
 #include <stdlib.h>
 #include <unistd.h>
lib/io.c +4 -0
index 52f9424..5b998d8 100644
@@ -6,8 +6,12 @@
  *             http://www.huawei.com/
  * Created by Li Guifu <[email protected]>
  */
+#ifndef _LARGEFILE64_SOURCE
 #define _LARGEFILE64_SOURCE
+#endif
+#ifndef _GNU_SOURCE
 #define _GNU_SOURCE
+#endif
 #include <sys/stat.h>
 #include <sys/ioctl.h>
 #include "erofs/io.h"
Signature · 1 line
2.20.1
author Reviewed-by Li Guifu on v1 1/1
#2 lore raw
Quoted 7 lines · Gao Xiang

From: Gao Xiang <[email protected]>

This patch can be used to resolve the following build errors:

compress.c:10: error: "_LARGEFILE64_SOURCE" redefined [-Werror]
#define _LARGEFILE64_SOURCE

Quoted 8 lines

<command-line>: note: this is the location of the previous definition

io.c:9: error: "_LARGEFILE64_SOURCE" redefined [-Werror]
#define _LARGEFILE64_SOURCE

<command-line>: note: this is the location of the previous definition

It looks good

Thanks

Reviewed-by on v1 1/1
#3 lore raw
In reply to Gao Xiang via Linux-erofs
Quoted 7 lines · Gao Xiang via Linux-erofs

From: Gao Xiang <[email protected]>

This patch can be used to resolve the following build errors:

compress.c:10: error: "_LARGEFILE64_SOURCE" redefined [-Werror]
#define _LARGEFILE64_SOURCE

Quoted 8 lines

<command-line>: note: this is the location of the previous definition

io.c:9: error: "_LARGEFILE64_SOURCE" redefined [-Werror]
#define _LARGEFILE64_SOURCE

<command-line>: note: this is the location of the previous definition

Thanks,