All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: weil@mail.berlios.de, hpoussin@reactos.org,
	lcapitulino@redhat.com, Anthony Liguori <anthony@codemonkey.ws>,
	qemu-devel@nongnu.org, berrange@redhat.com
Subject: [Qemu-devel] [PATCH] configure: verify stdio.h
Date: Tue, 26 Jan 2010 16:16:32 +0200	[thread overview]
Message-ID: <20100126141632.GA20173@redhat.com> (raw)

Verify that stdio.h supports %ll and %z
Some migw variants don't unless requested explicitly (see
http://www.mail-archive.com/mingw-w64-public@lists.sourceforge.net/msg00417.html)
), detect them early.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 configure |   25 +++++++++++++++++++++++++
 1 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/configure b/configure
index 5631bbb..7bbe4bc 100755
--- a/configure
+++ b/configure
@@ -123,6 +123,31 @@ else
     exit 1
 fi
 
+# Check that stdio.h compiler is sane: some
+# mingw variants do not support %z %l that we rely on
+cat > $TMPC <<EOF
+#include <stddef.h>
+#include <stdio.h>
+size_t z = 1;
+long long ll = 2;
+int main(void) {
+  printf("z=%zd;ll=%lld;\n", z, ll);
+  return 0;
+}
+EOF
+
+if compile_prog && ($TMPE | grep "z=1;ll=2;" > /dev/null); then
+  : C compiler works ok
+else
+    echo "ERROR: \"$cc\" does not have a working stdio.h"
+    exit 1
+fi
+
+cat > $TMPC << EOF
+#include <unistd.h>
+int main(void) { return fdatasync(0); }
+EOF
+
 check_define() {
 cat > $TMPC <<EOF
 #if !defined($1)
-- 
1.6.6.144.g5c3af

                 reply	other threads:[~2010-01-26 14:19 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20100126141632.GA20173@redhat.com \
    --to=mst@redhat.com \
    --cc=anthony@codemonkey.ws \
    --cc=berrange@redhat.com \
    --cc=hpoussin@reactos.org \
    --cc=lcapitulino@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=weil@mail.berlios.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.