linux-erofs.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Gao Xiang via Linux-erofs <linux-erofs@lists.ozlabs.org>
To: linux-erofs@lists.ozlabs.org, Li Guifu <bluce.liguifu@huawei.com>,
	Li GuiFu <bluce.lee@aliyun.com>
Subject: [PATCH] erofs-utils: avoid _LARGEFILE64_SOURCE and _GNU_SOURCE redefinition
Date: Sat, 14 Mar 2020 18:52:56 +0800	[thread overview]
Message-ID: <20200314105256.20142-1-hsiangkao@aol.com> (raw)
In-Reply-To: 20200314105256.20142-1-hsiangkao.ref@aol.com

From: Gao Xiang <gaoxiang25@huawei.com>

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


       reply	other threads:[~2020-03-14 10:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20200314105256.20142-1-hsiangkao.ref@aol.com>
2020-03-14 10:52 ` Gao Xiang via Linux-erofs [this message]
2020-03-26 16:18   ` [PATCH] erofs-utils: avoid _LARGEFILE64_SOURCE and _GNU_SOURCE redefinition Li GuiFu via Linux-erofs
2020-03-27  7:40   ` Chao Yu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200314105256.20142-1-hsiangkao@aol.com \
    --to=linux-erofs@lists.ozlabs.org \
    --cc=bluce.lee@aliyun.com \
    --cc=bluce.liguifu@huawei.com \
    --cc=hsiangkao@aol.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).