[PATCH] Fix "identifier redeclared" compilation error with SUN cc

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Junio C Hamano <gitster@...>
Cc: Björn <B.Steinbrink@...>, <raa.lkml@...>, <git@...>, <git@...>
Date: Monday, November 19, 2007 - 1:51 pm

Hello Junio,

On Thu, 15 Nov 2007, Junio C Hamano wrote:

it looks ok on Solaris. I assembled the following patch from your posting, 
could you please include it?


Signed-off-by: Guido Ostkamp <git@ostkamp.fastmail.fm>
---
  git-compat-util.h |   11 ++++++++++-
  1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/git-compat-util.h b/git-compat-util.h
index 276a437..97759fd 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -4,11 +4,20 @@
  #define _FILE_OFFSET_BITS 64

  #ifndef FLEX_ARRAY
-#if defined(__GNUC__) && (__GNUC__ < 3)
+#if defined(__GNUC__)
+#if (__GNUC__ < 3)
  #define FLEX_ARRAY 0
  #else
  #define FLEX_ARRAY /* empty */
  #endif
+#else
+/* more cases we know we can use 0 or empty can come here */
+#endif
+#endif
+
+/* if still undefined, default to the safe, old fashioned way */
+#ifndef FLEX_ARRAY
+#define FLEX_ARRAY 1
  #endif

  #define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0]))
-- 
1.5.3.6.728.gea559



-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] Fix Solaris Workshop Compiler issues, Guido Ostkamp, (Wed Nov 14, 4:31 pm)
Re: [PATCH] Fix Solaris Workshop Compiler issues, Alex Riesen, (Wed Nov 14, 4:47 pm)
Re: [PATCH] Fix Solaris Workshop Compiler issues, Junio C Hamano, (Wed Nov 14, 5:25 pm)
Re: [PATCH] Fix Solaris Workshop Compiler issues, Guido Ostkamp, (Wed Nov 14, 7:21 pm)
Re: [PATCH] Fix Solaris Workshop Compiler issues, Alex Riesen, (Wed Nov 14, 7:28 pm)
Re: [PATCH] Fix Solaris Workshop Compiler issues, Junio C Hamano, (Wed Nov 14, 8:30 pm)
Re: [PATCH] Fix Solaris Workshop Compiler issues, Linus Torvalds, (Wed Nov 14, 8:44 pm)
Re: [PATCH] Fix Solaris Workshop Compiler issues, David Kastrup, (Wed Nov 14, 9:21 pm)
Re: [PATCH] Fix Solaris Workshop Compiler issues, Junio C Hamano, (Wed Nov 14, 11:27 pm)
Re: [PATCH] Fix Solaris Workshop Compiler issues, Linus Torvalds, (Wed Nov 14, 9:53 pm)
Re: [PATCH] Fix Solaris Workshop Compiler issues, Junio C Hamano, (Wed Nov 14, 8:46 pm)
[PATCH] Fix "identifier redeclared" compilation error with S..., Björn Steinbrink, (Wed Nov 14, 9:15 pm)
[PATCH] Fix "identifier redeclared" compilation error with S..., Guido Ostkamp, (Mon Nov 19, 1:51 pm)
[PATCH] Add mkdtemp() workaround for Sun Solaris 10, Guido Ostkamp, (Fri Nov 16, 2:59 pm)
[RFH] Solaris portability, Junio C Hamano, (Fri Nov 16, 8:33 pm)
Re: [RFH] Solaris portability, Guido Ostkamp, (Sun Nov 18, 8:08 am)
Re: [RFH] Solaris portability, Junio C Hamano, (Sun Nov 18, 1:46 pm)