From 1eda0b78a907e44c655f757448ec0499d494b328 Mon Sep 17 00:00:00 2001
From: Ian Lynagh <ian@well-typed.com>
Date: Sat, 12 Jan 2013 13:40:16 +0000
Subject: [PATCH] Change RTS hook APIs to match 7.6.1

---
 ghc/hschooks.c            | 2 +-
 includes/rts/Hooks.h      | 6 +++---
 rts/hooks/MallocFail.c    | 2 +-
 rts/hooks/OutOfHeap.c     | 2 +-
 rts/hooks/StackOverflow.c | 2 +-
 5 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/ghc/hschooks.c b/ghc/hschooks.c
index fbcfda7c355d..232ac08045cb 100644
--- a/ghc/hschooks.c
+++ b/ghc/hschooks.c
@@ -32,7 +32,7 @@ defaultsHook (void)
 }
 
 void
-StackOverflowHook (StgWord stack_size)    /* in bytes */
+StackOverflowHook (lnat stack_size)    /* in bytes */
 {
     fprintf(stderr, "GHC stack-space overflow: current limit is %zu bytes.\nUse the `-K<size>' option to increase it.\n", (size_t)stack_size);
 }
diff --git a/includes/rts/Hooks.h b/includes/rts/Hooks.h
index f536afaa099b..f409205b8787 100644
--- a/includes/rts/Hooks.h
+++ b/includes/rts/Hooks.h
@@ -18,9 +18,9 @@ extern char *ghc_rts_opts;
 
 extern void OnExitHook (void);
 extern int  NoRunnableThreadsHook (void);
-extern void StackOverflowHook (W_ stack_size);
-extern void OutOfHeapHook (W_ request_size, W_ heap_size);
-extern void MallocFailHook (W_ request_size /* in bytes */, char *msg);
+extern void StackOverflowHook (lnat stack_size);
+extern void OutOfHeapHook (lnat request_size, lnat heap_size);
+extern void MallocFailHook (lnat request_size /* in bytes */, char *msg);
 extern void defaultsHook (void);
 
 #endif /* RTS_HOOKS_H */
diff --git a/rts/hooks/MallocFail.c b/rts/hooks/MallocFail.c
index 6c3a1a0faf9c..19874234d0a8 100644
--- a/rts/hooks/MallocFail.c
+++ b/rts/hooks/MallocFail.c
@@ -10,7 +10,7 @@
 #include <stdio.h>
 
 void
-MallocFailHook (W_ request_size /* in bytes */, char *msg)
+MallocFailHook (lnat request_size /* in bytes */, char *msg)
 {
     fprintf(stderr, "malloc: failed on request for %" FMT_Word " bytes; message: %s\n", request_size, msg);
 }
diff --git a/rts/hooks/OutOfHeap.c b/rts/hooks/OutOfHeap.c
index ec4697b54711..271c6a1ecde1 100644
--- a/rts/hooks/OutOfHeap.c
+++ b/rts/hooks/OutOfHeap.c
@@ -9,7 +9,7 @@
 #include <stdio.h>
 
 void
-OutOfHeapHook (W_ request_size, W_ heap_size) /* both sizes in bytes */
+OutOfHeapHook (lnat request_size, lnat heap_size) /* both sizes in bytes */
 {
   /*    fprintf(stderr, "Heap exhausted;\nwhile trying to allocate %lu bytes in a %lu-byte heap;\nuse `+RTS -H<size>' to increase the total heap size.\n", */
 
diff --git a/rts/hooks/StackOverflow.c b/rts/hooks/StackOverflow.c
index 407293902d87..135e40857dd2 100644
--- a/rts/hooks/StackOverflow.c
+++ b/rts/hooks/StackOverflow.c
@@ -10,7 +10,7 @@
 #include <stdio.h>
 
 void
-StackOverflowHook (W_ stack_size)    /* in bytes */
+StackOverflowHook (lnat stack_size)    /* in bytes */
 {
     fprintf(stderr, "Stack space overflow: current size %" FMT_Word " bytes.\nUse `+RTS -Ksize -RTS' to increase it.\n", stack_size);
 }
-- 
GitLab