@matheusbsbs / matheus-bagliano / commits / 46efd2d93c
Fork 0

Rename warn() to warning() to fix symbol conflicts on BSD and Mac OS

This fixes a problem reported by Randal Schwartz: >I finally tracked down all the (albeit inconsequential) errors I was getting >on both OpenBSD and OSX. It's the warn() function in usage.c. There's >warn(3) in BSD-style distros. It'd take a "great rename" to change it, but if >someone with better C skills than I have could do that, my linker and I would >appreciate it. It was annoying to me, too, when I was doing some mergetool testing on Mac OS X, so here's a fix. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu> Cc: "Randal L. Schwartz" <merlyn@stonehenge.com> Signed-off-by: Junio C Hamano <junkio@cox.net>

Theodore Ts'o committed Mar 30, 2007 at 19:07 UTC 46efd2d93ce39fd5c1a91f0a2f918f2d8bbfdf92
5 files changed +6 -6
builtin-bundle.c
+2 -2
@@ -87,7 +87,7 @@ static int read_header(const char *path, struct bundle_header *header) {
87 if (buffer[len - 1] == '\n')
88 buffer[len - 1] = '\0';
89 if (get_sha1_hex(buffer + offset, sha1)) {
90 - warn("unrecognized header: %s", buffer);
90 + warning("unrecognized header: %s", buffer);
91 continue;
92 }
93 delim = buffer[40 + offset];
@@ -268,7 +268,7 @@ static int create_bundle(struct bundle_header *header, const char *path,
268 * from getting output.
269 */
270 if (!(e->item->flags & SHOWN)) {
271 - warn("ref '%s' is excluded by the rev-list options",
271 + warning("ref '%s' is excluded by the rev-list options",
272 e->name);
273 continue;
274 }
fast-import.c
+1 -1
@@ -1312,7 +1312,7 @@ static int update_branch(struct branch *b)
1312
1313 if (!in_merge_bases(old_cmit, &new_cmit, 1)) {
1314 unlock_ref(lock);
1315 - warn("Not updating %s"
1315 + warning("Not updating %s"
1316 " (new tip %s does not contain %s)",
1317 b->name, sha1_to_hex(b->sha1), sha1_to_hex(old_sha1));
1318 return -1;
git-compat-util.h
+1 -1
@@ -87,7 +87,7 @@
87 extern void usage(const char *err) NORETURN;
88 extern void die(const char *err, ...) NORETURN __attribute__((format (printf, 1, 2)));
89 extern int error(const char *err, ...) __attribute__((format (printf, 1, 2)));
90 -extern void warn(const char *err, ...) __attribute__((format (printf, 1, 2)));
90 +extern void warning(const char *err, ...) __attribute__((format (printf, 1, 2)));
91
92 extern void set_usage_routine(void (*routine)(const char *err) NORETURN);
93 extern void set_die_routine(void (*routine)(const char *err, va_list params) NORETURN);
revision.c
+1 -1
@@ -486,7 +486,7 @@ static void handle_one_reflog_commit(unsigned char *sha1, void *cb_data)
486 add_pending_object(cb->all_revs, o, "");
487 }
488 else if (!cb->warned_bad_reflog) {
489 - warn("reflog of '%s' references pruned commits",
489 + warning("reflog of '%s' references pruned commits",
490 cb->name_for_errormsg);
491 cb->warned_bad_reflog = 1;
492 }
usage.c
+1 -1
@@ -86,7 +86,7 @@ int error(const char *err, ...)
86 return -1;
87 }
88
89 -void warn(const char *warn, ...)
89 +void warning(const char *warn, ...)
90 {
91 va_list params;
92