From patchwork Tue Jan 26 14:16:32 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: configure: verify stdio.h X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 43701 Message-Id: <20100126141632.GA20173@redhat.com> To: weil@mail.berlios.de, hpoussin@reactos.org, lcapitulino@redhat.com, Anthony Liguori , qemu-devel@nongnu.org, berrange@redhat.com Cc: Date: Tue, 26 Jan 2010 16:16:32 +0200 From: "Michael S. Tsirkin" List-Id: qemu-devel.nongnu.org 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 --- 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 < +#include +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 +int main(void) { return fdatasync(0); } +EOF + check_define() { cat > $TMPC <