* [PATCH] Fix a strchrnul() related build error
@ 2007-11-12 21:01 Emil Medve
2007-11-12 21:27 ` Johannes Schindelin
0 siblings, 1 reply; 3+ messages in thread
From: Emil Medve @ 2007-11-12 21:01 UTC (permalink / raw)
To: gitster, ae, git; +Cc: Emil Medve
Systems/environments without glibc (such as CygWin), and as a consequence whithout the
__GLIBC_PREREQ() macro, fail to build with the following error message:
CC git.o
In file included from builtin.h:4,
from git.c:1:
git-compat-util.h:187:48: missing binary operator before token "("
Signed-off-by: Emil Medve <Emilian.Medve@Freescale.com>
---
Here is a relevant comment from my Linux box features.h:
/* Convenience macros to test the versions of glibc and gcc.
Use them like this:
#if __GNUC_PREREQ (2,8)
... code requiring gcc 2.8 or later ...
#endif
Note - they won't work for gcc1 or glibc1, since the _MINOR macros
were not defined then. */
My CygWin gcc version is:
$ gcc -dumpversion
3.4.4
This applies to next
git-compat-util.h | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/git-compat-util.h b/git-compat-util.h
index 3d147b6..c4ed308 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -184,7 +184,13 @@ void *gitmemmem(const void *haystack, size_t haystacklen,
const void *needle, size_t needlelen);
#endif
-#if !defined(__GLIBC_PREREQ) && !__GLIBC_PREREQ(2, 1)
+#ifndef __GLIBC_PREREQ
+#define NO_STRCHRNUL
+#elif !__GLIBC_PREREQ(2, 1)
+#define NO_STRCHRNUL
+#endif
+
+#ifdef NO_STRCHRNUL
#define strchrnul gitstrchrnul
static inline char *gitstrchrnul(const char *s, int c)
{
--
1.5.3.5.1466.gfa36
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] Fix a strchrnul() related build error
2007-11-12 21:01 [PATCH] Fix a strchrnul() related build error Emil Medve
@ 2007-11-12 21:27 ` Johannes Schindelin
2007-11-12 22:12 ` Medve Emilian
0 siblings, 1 reply; 3+ messages in thread
From: Johannes Schindelin @ 2007-11-12 21:27 UTC (permalink / raw)
To: Emil Medve; +Cc: gitster, ae, git
Hi,
didn't Johannes Sixt provide a (slightly nicer) patch earlier today?
Ciao,
Dscho
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: [PATCH] Fix a strchrnul() related build error
2007-11-12 21:27 ` Johannes Schindelin
@ 2007-11-12 22:12 ` Medve Emilian
0 siblings, 0 replies; 3+ messages in thread
From: Medve Emilian @ 2007-11-12 22:12 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: gitster, ae, git
Hi Dscho,
> didn't Johannes Sixt provide a (slightly nicer) patch earlier today?
That is nicer and should go into the tree.
Cheers,
Emil.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-11-12 22:12 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-12 21:01 [PATCH] Fix a strchrnul() related build error Emil Medve
2007-11-12 21:27 ` Johannes Schindelin
2007-11-12 22:12 ` Medve Emilian
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).