summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarel Gardas <karel.gardas@centrum.cz>2012-11-08 22:04:44 +0100
committerIan Lynagh <ian@well-typed.com>2012-11-08 21:50:01 +0000
commit71f7ab6a05448e48a3b5741bb8a5ef57701e9c70 (patch)
tree57317c1ba838a5349e8f8e46e8781f0f90e911c8
parent7dd7008f98c76024288899b8cea607141c91ada5 (diff)
downloadhaskell-71f7ab6a05448e48a3b5741bb8a5ef57701e9c70.tar.gz
define own version of PRIdPTR on platform where its not available
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.
-rw-r--r--includes/mkDerivedConstants.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/includes/mkDerivedConstants.c b/includes/mkDerivedConstants.c
index 7009a3fca8..bd2214e696 100644
--- a/includes/mkDerivedConstants.c
+++ b/includes/mkDerivedConstants.c
@@ -30,6 +30,16 @@
#include <stdio.h>
#include <string.h>
+#if !defined(PRIdPTR)
+#if SIZEOF_VOID_P == SIZEOF_INT
+/* compiling for 32bit target */
+#define PRIdPTR "d"
+#else
+/* compiling for 64bit target */
+#define PRIdPTR "ld"
+#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