git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Sixt <J.Sixt@eudaptics.com>
To: "Shawn O. Pearce" <spearce@spearce.org>
Cc: Junio C Hamano <gitster@pobox.com>, git@vger.kernel.org
Subject: va_copy is not available on all systems.
Date: Mon, 20 Aug 2007 15:16:56 +0200	[thread overview]
Message-ID: <46C99448.2AB33DFF@eudaptics.com> (raw)

This is just too ugly to be included...

die_nicely() uses the variable argument list twice. The recent fix for
this in 7e5dcea8311 uses va_copy. However, on older systems this function
is not available. This fix assumes that those systems that do have
the function actually implement it as macro, and we use it to remove
the entire nicely() functionality.

Since va_copy() must be provided by the compiler, we don't have a
reasonable chance to provide a working definition in git_compat_util.h.
---
 fast-import.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/fast-import.c b/fast-import.c
index 2d5224c..edc76a4 100644
--- a/fast-import.c
+++ b/fast-import.c
@@ -349,6 +349,7 @@ static unsigned int cmd_save = 100;
 static uintmax_t next_mark;
 static struct dbuf new_data;
 
+#ifdef va_copy
 static void write_branch_report(FILE *rpt, struct branch *b)
 {
 	fprintf(rpt, "%s:\n", b->name);
@@ -456,6 +457,7 @@ static NORETURN void die_nicely(const char *err, va_list params)
 	va_end(x_params);
 	exit(128);
 }
+#endif
 
 static void alloc_objects(unsigned int cnt)
 {
@@ -2381,7 +2383,9 @@ int main(int argc, const char **argv)
 
 	prepare_packed_git();
 	start_packfile();
+#ifdef va_copy
 	set_die_routine(die_nicely);
+#endif
 	for (;;) {
 		read_next_command();
 		if (command_buf.eof)
-- 
1.5.3.rc5.15.g8ddb

             reply	other threads:[~2007-08-20 13:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-20 13:16 Johannes Sixt [this message]
2007-08-20 13:39 ` va_copy is not available on all systems Michael Poole
2007-08-20 19:15 ` Alex Riesen
2007-08-21  3:38   ` Shawn O. Pearce
2007-08-21  4:53     ` Junio C Hamano
2007-08-21 18:37     ` Alex Riesen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=46C99448.2AB33DFF@eudaptics.com \
    --to=j.sixt@eudaptics.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=spearce@spearce.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).