From 1a53fdc7573472cc3da05eaa446e99431353a8b8 Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Wed, 5 May 2010 00:27:00 +0100 Subject: [PATCH] try to support size independent printf --- H/Yap.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/H/Yap.h b/H/Yap.h index dedf68d3f..5598ef636 100644 --- a/H/Yap.h +++ b/H/Yap.h @@ -158,10 +158,16 @@ /* */ typedef int Int; /* */ typedef unsigned int UInt; +#define Int_FORMAT "%d" +#define UInt_FORMAT "%u" + #elif SIZEOF_LONG_INT==4 /* */ typedef long int Int; /* */ typedef unsigned long int UInt; +#define Int_FORMAT "%l" +#define UInt_FORMAT "%ul" + #else # error Yap require integer types of the same size as a pointer #endif @@ -180,14 +186,23 @@ /* */ typedef int Int; /* */ typedef unsigned int UInt; +#define Int_FORMAT "%d" +#define UInt_FORMAT "%ud" + #elif SIZEOF_LONG_INT==8 /* */ typedef long int Int; /* */ typedef unsigned long int UInt; +#define Int_FORMAT "%l" +#define UInt_FORMAT "%ul" + # elif SIZEOF_LONG_LONG_INT==8 /* */ typedef long long int Int; /* */ typedef unsigned long long int UInt; +#define Int_FORMAT "%I64d" +#define UInt_FORMAT "%I64u" + # else # error Yap requires integer types of the same size as a pointer # endif