aboutsummaryrefslogtreecommitdiff
path: root/package/erofs-utils/0002-erofs-utils-avoid-_LARGEFILE64_SOURCE-and-_GNU_SOURC.patch
blob: 0b6ecab71bf6101fb50b44a06275b6bf98b26562 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
From 41d6c984699f30c11e8c92550239bbe5a3e5ada1 Mon Sep 17 00:00:00 2001
From: Gao Xiang <gaoxiang25@huawei.com>
Date: Sat, 14 Mar 2020 17:05:37 +0800
Subject: [PATCH] erofs-utils: avoid _LARGEFILE64_SOURCE and _GNU_SOURCE
 redefinition

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

Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
---
 lib/compress.c | 2 ++
 lib/io.c       | 4 ++++
 2 files changed, 6 insertions(+)

diff --git a/lib/compress.c b/lib/compress.c
index 8337487..b14ff17 100644
--- a/lib/compress.c
+++ b/lib/compress.c
@@ -7,7 +7,9 @@
  * Created by Miao Xie <miaoxie@huawei.com>
  * with heavy changes by Gao Xiang <gaoxiang25@huawei.com>
  */
+#ifndef _LARGEFILE64_SOURCE
 #define _LARGEFILE64_SOURCE
+#endif
 #include <string.h>
 #include <stdlib.h>
 #include <unistd.h>
diff --git a/lib/io.c b/lib/io.c
index 52f9424..5b998d8 100644
--- a/lib/io.c
+++ b/lib/io.c
@@ -6,8 +6,12 @@
  *             http://www.huawei.com/
  * Created by Li Guifu <bluce.liguifu@huawei.com>
  */
+#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"
-- 
2.20.1