linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
To: linux-sparse@vger.kernel.org
Cc: "Uwe Kleine-König" <uwe@kleine-koenig.org>,
	"Luc Van Oostenryck" <luc.vanoostenryck@gmail.com>
Subject: [PATCH] fix build on Hurd which doesn't define PATH_MAX
Date: Sat,  1 Aug 2020 14:20:11 +0200	[thread overview]
Message-ID: <20200801122011.40207-1-luc.vanoostenryck@gmail.com> (raw)

Hurd doesn't define PATH_MAX but is needed by pre-process.c
and sindex.c.

pre-process.c had already its local define but sindex doesn't.
So, allow sindex to build on Hurd and avoid possible problems
with some future tools by moving the default define of 4096
for it to lib.h where it will be visible for all code.

Reported-by: Uwe Kleine-König <uwe@kleine-koenig.org>
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
 lib.h         | 4 ++++
 pre-process.c | 4 ----
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib.h b/lib.h
index e767840c1038..17b17a72f531 100644
--- a/lib.h
+++ b/lib.h
@@ -43,6 +43,10 @@
 #define ARRAY_SIZE(x) (sizeof(x)/sizeof((x)[0]))
 #endif
 
+#ifndef PATH_MAX
+#define PATH_MAX 4096			// Hurd doesn't define this
+#endif
+
 extern int verbose, optimize_level, optimize_size, preprocessing;
 extern int die_if_error;
 extern int repeat_phase;
diff --git a/pre-process.c b/pre-process.c
index 38167802f465..ca613018720a 100644
--- a/pre-process.c
+++ b/pre-process.c
@@ -890,10 +890,6 @@ static void set_stream_include_path(struct stream *stream)
 	includepath[0] = path;
 }
 
-#ifndef PATH_MAX
-#define PATH_MAX 4096	// for Hurd where it's not defined
-#endif
-
 static int try_include(const char *path, const char *filename, int flen, struct token **where, const char **next_path)
 {
 	int fd;

base-commit: b24508f10b9a24b01bd41289f440942ff79b197e
-- 
2.28.0


                 reply	other threads:[~2020-08-01 12:20 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20200801122011.40207-1-luc.vanoostenryck@gmail.com \
    --to=luc.vanoostenryck@gmail.com \
    --cc=linux-sparse@vger.kernel.org \
    --cc=uwe@kleine-koenig.org \
    /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).