Note that PRIdPTR is considered as linux-ism so it's not available on platforms
like Solaris, although some other free Unix(-like) OSes apparently supports
it too.
---
 includes/mkDerivedConstants.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/includes/mkDerivedConstants.c b/includes/mkDerivedConstants.c
index 1393112..953b2b5 100644
--- a/includes/mkDerivedConstants.c
+++ b/includes/mkDerivedConstants.c
@@ -30,6 +30,17 @@
 #include <stdio.h>
 #include <string.h>
 
+
+#if !defined(PRIdPTR)
+#if defined(_LP64)
+/* compiling for 64bit target */
+#define PRIdPTR "ld"
+#else
+/* compiling for 32bit target */
+#define PRIdPTR "d"
+#endif
+#endif
+
 enum Mode { Gen_Haskell_Type, Gen_Haskell_Value, Gen_Haskell_Wrappers, 
Gen_Haskell_Exports, Gen_Header } mode;
 
 #define str(a,b) #a "_" #b
-- 
1.7.3.2


_______________________________________________
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to