Commit 9b588c57 authored by simonmar's avatar simonmar

[project @ 2004-09-02 12:34:05 by simonmar]

Make the UPD_IND macros compatible with older gccs that don't accept
declarations in the middle of a block.
parent 583493b6
...@@ -40,11 +40,15 @@ ...@@ -40,11 +40,15 @@
* impedence matching: * impedence matching:
*/ */
#ifdef CMINUSMINUS #ifdef CMINUSMINUS
#define BLOCK_BEGIN
#define BLOCK_END
#define DECLARE_IPTR(info) W_ info #define DECLARE_IPTR(info) W_ info
#define FCALL foreign "C" #define FCALL foreign "C"
#define INFO_PTR(info) info #define INFO_PTR(info) info
#define ARG_PTR "ptr" #define ARG_PTR "ptr"
#else #else
#define BLOCK_BEGIN {
#define BLOCK_END }
#define DECLARE_IPTR(info) const StgInfoTable *(info) #define DECLARE_IPTR(info) const StgInfoTable *(info)
#define FCALL /* nothing */ #define FCALL /* nothing */
#define INFO_PTR(info) &info #define INFO_PTR(info) &info
...@@ -56,43 +60,51 @@ ...@@ -56,43 +60,51 @@
/* UPD_IND actually does a PERM_IND if TICKY_TICKY is on; /* UPD_IND actually does a PERM_IND if TICKY_TICKY is on;
if you *really* need an IND use UPD_REAL_IND if you *really* need an IND use UPD_REAL_IND
*/ */
#define UPD_REAL_IND(updclosure, ind_info, heapptr, and_then) \ #define UPD_REAL_IND(updclosure, ind_info, heapptr, and_then) \
DECLARE_IPTR(info); \ BLOCK_BEGIN \
info = GET_INFO(updclosure); \ DECLARE_IPTR(info); \
AWAKEN_BQ(info,updclosure); \ info = GET_INFO(updclosure); \
updateWithIndirection(GET_INFO(updclosure), ind_info, \ AWAKEN_BQ(info,updclosure); \
updclosure, \ updateWithIndirection(GET_INFO(updclosure), ind_info, \
heapptr, \ updclosure, \
and_then); heapptr, \
and_then); \
BLOCK_END
#if defined(PROFILING) || defined(TICKY_TICKY) #if defined(PROFILING) || defined(TICKY_TICKY)
#define UPD_PERM_IND(updclosure, heapptr) \ #define UPD_PERM_IND(updclosure, heapptr) \
BLOCK_BEGIN \
DECLARE_IPTR(info); \ DECLARE_IPTR(info); \
info = GET_INFO(updclosure); \ info = GET_INFO(updclosure); \
AWAKEN_BQ(info,updclosure); \ AWAKEN_BQ(info,updclosure); \
updateWithPermIndirection(info, \ updateWithPermIndirection(info, \
updclosure, \ updclosure, \
heapptr); heapptr); \
BLOCK_END
#endif #endif
#if defined(RTS_SUPPORTS_THREADS) #if defined(RTS_SUPPORTS_THREADS)
# ifdef TICKY_TICKY # ifdef TICKY_TICKY
# define UPD_IND_NOLOCK(updclosure, heapptr) \ # define UPD_IND_NOLOCK(updclosure, heapptr) \
BLOCK_BEGIN \
DECLARE_IPTR(info); \ DECLARE_IPTR(info); \
info = GET_INFO(updclosure); \ info = GET_INFO(updclosure); \
AWAKEN_BQ_NOLOCK(info,updclosure); \ AWAKEN_BQ_NOLOCK(info,updclosure); \
updateWithPermIndirection(info, \ updateWithPermIndirection(info, \
updclosure, \ updclosure, \
heapptr) heapptr); \
BLOCK_END
# else # else
# define UPD_IND_NOLOCK(updclosure, heapptr) \ # define UPD_IND_NOLOCK(updclosure, heapptr) \
BLOCK_BEGIN \
DECLARE_IPTR(info); \ DECLARE_IPTR(info); \
info = GET_INFO(updclosure); \ info = GET_INFO(updclosure); \
AWAKEN_BQ_NOLOCK(info,updclosure); \ AWAKEN_BQ_NOLOCK(info,updclosure); \
updateWithIndirection(info, INFO_PTR(stg_IND_info), \ updateWithIndirection(info, INFO_PTR(stg_IND_info), \
updclosure, \ updclosure, \
heapptr,); heapptr,); \
BLOCK_END
# endif # endif
#else #else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment