git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] Make git compile with SUNs forte12 compiler

From
TGThomas Glanzmann <sithglan@stud.uni-erlangen.de>
Date
May 12, 2007, 21:35 UTC
Message-ID
<11790057101792-git-send-email-sithglan@stud.uni-erlangen.de>

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
Next: Matthieu CASTET
Message 1 of 6 in “Make git compile with SUNs forte12 compiler”
  1. Make git compile with SUNs forte12 compilerThomas Glanzmann, May 12, 2007
  2. Matthieu CASTETMay 13, 2007
  3. Thomas GlanzmannMay 13, 2007
  4. matthieu castetMay 13, 2007
  5. Johannes SchindelinMay 13, 2007
  6. Thomas GlanzmannMay 13, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.