git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Make git compile with SUNs forte12 compiler
@ 2007-05-12 21:35 Thomas Glanzmann
  2007-05-13  9:47 ` Matthieu CASTET
  2007-05-13 10:39 ` Johannes Schindelin
  0 siblings, 2 replies; 6+ messages in thread
From: Thomas Glanzmann @ 2007-05-12 21:35 UTC (permalink / raw)
  To: git; +Cc: Thomas Glanzmann

This patch moves two inline functions from a header file to the corresponding c
file. Otherwise forte12 refuses to compile git with the following error:

    LINK git-convert-objects
ld: fatal: symbol `tree_entry_extract' is multiply-defined:
        (file libgit.a(sha1_name.o) type=FUNC; file libgit.a(tree.o) type=FUNC);
ld: fatal: symbol `tree_entry_extract' is multiply-defined:
        (file libgit.a(sha1_name.o) type=FUNC; file libgit.a(tree-walk.o) type=FUNC);
ld: fatal: File processing errors. No output written to git-convert-objects
gmake[1]: *** [git-convert-objects] Error 1

Signed-off-by: Thomas Glanzmann <sithglan@stud.uni-erlangen.de>
---
 tree-walk.c |   14 ++++++++++++++
 tree-walk.h |   13 +------------
 2 files changed, 15 insertions(+), 12 deletions(-)

diff --git a/tree-walk.c b/tree-walk.c
index cbb24eb..ef57951 100644
--- a/tree-walk.c
+++ b/tree-walk.c
@@ -2,6 +2,20 @@
 #include "tree-walk.h"
 #include "tree.h"
 
+inline int tree_entry_len(const char *name, const unsigned char *sha1)
+{
+	return (char *)sha1 - (char *)name - 1;
+}
+
+inline const unsigned char *tree_entry_extract(struct tree_desc *desc,
+                                     const char **pathp, unsigned int *modep)
+{
+	*pathp = desc->entry.path;
+	*modep = canon_mode(desc->entry.mode);
+	return desc->entry.sha1;
+}
+
+
 static const char *get_mode(const char *str, unsigned int *modep)
 {
 	unsigned char c;
diff --git a/tree-walk.h b/tree-walk.h
index 43458cf..984f19e 100644
--- a/tree-walk.h
+++ b/tree-walk.h
@@ -13,21 +13,10 @@ struct tree_desc {
 	unsigned int size;
 };
 
-static inline const unsigned char *tree_entry_extract(struct tree_desc *desc, const char **pathp, unsigned int *modep)
-{
-	*pathp = desc->entry.path;
-	*modep = canon_mode(desc->entry.mode);
-	return desc->entry.sha1;
-}
-
-static inline int tree_entry_len(const char *name, const unsigned char *sha1)
-{
-	return (char *)sha1 - (char *)name - 1;
-}
-
 void update_tree_entry(struct tree_desc *);
 void init_tree_desc(struct tree_desc *desc, const void *buf, unsigned long size);
 const unsigned char *tree_entry_extract(struct tree_desc *, const char **, unsigned int *);
+int tree_entry_len(const char *name, const unsigned char *sha1);
 
 /* Helper function that does both of the above and returns true for success */
 int tree_entry(struct tree_desc *, struct name_entry *);
-- 
1.5.1.3

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-05-13 12:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-12 21:35 [PATCH] Make git compile with SUNs forte12 compiler Thomas Glanzmann
2007-05-13  9:47 ` Matthieu CASTET
2007-05-13 10:30   ` Thomas Glanzmann
2007-05-13 12:52     ` matthieu castet
2007-05-13 10:39 ` Johannes Schindelin
2007-05-13 10:52   ` Thomas Glanzmann

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).