From: simonmar Date: Thu, 2 Sep 2004 12:34:05 +0000 (+0000) Subject: [project @ 2004-09-02 12:34:05 by simonmar] X-Git-Tag: Initial_conversion_from_CVS_complete~1646 X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=9b588c57cf0d2cb4f360d5155a9b456605c0e8be [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. --- diff --git a/ghc/includes/Updates.h b/ghc/includes/Updates.h index 1f12030..68241d7 100644 --- a/ghc/includes/Updates.h +++ b/ghc/includes/Updates.h @@ -40,11 +40,15 @@ * impedence matching: */ #ifdef CMINUSMINUS +#define BLOCK_BEGIN +#define BLOCK_END #define DECLARE_IPTR(info) W_ info #define FCALL foreign "C" #define INFO_PTR(info) info #define ARG_PTR "ptr" #else +#define BLOCK_BEGIN { +#define BLOCK_END } #define DECLARE_IPTR(info) const StgInfoTable *(info) #define FCALL /* nothing */ #define INFO_PTR(info) &info @@ -56,43 +60,51 @@ /* UPD_IND actually does a PERM_IND if TICKY_TICKY is on; if you *really* need an IND use UPD_REAL_IND */ -#define UPD_REAL_IND(updclosure, ind_info, heapptr, and_then) \ - DECLARE_IPTR(info); \ - info = GET_INFO(updclosure); \ - AWAKEN_BQ(info,updclosure); \ - updateWithIndirection(GET_INFO(updclosure), ind_info, \ - updclosure, \ - heapptr, \ - and_then); +#define UPD_REAL_IND(updclosure, ind_info, heapptr, and_then) \ + BLOCK_BEGIN \ + DECLARE_IPTR(info); \ + info = GET_INFO(updclosure); \ + AWAKEN_BQ(info,updclosure); \ + updateWithIndirection(GET_INFO(updclosure), ind_info, \ + updclosure, \ + heapptr, \ + and_then); \ + BLOCK_END #if defined(PROFILING) || defined(TICKY_TICKY) #define UPD_PERM_IND(updclosure, heapptr) \ + BLOCK_BEGIN \ DECLARE_IPTR(info); \ info = GET_INFO(updclosure); \ AWAKEN_BQ(info,updclosure); \ updateWithPermIndirection(info, \ updclosure, \ - heapptr); + heapptr); \ + BLOCK_END #endif #if defined(RTS_SUPPORTS_THREADS) # ifdef TICKY_TICKY # define UPD_IND_NOLOCK(updclosure, heapptr) \ + BLOCK_BEGIN \ DECLARE_IPTR(info); \ info = GET_INFO(updclosure); \ AWAKEN_BQ_NOLOCK(info,updclosure); \ updateWithPermIndirection(info, \ updclosure, \ - heapptr) + heapptr); \ + BLOCK_END # else # define UPD_IND_NOLOCK(updclosure, heapptr) \ + BLOCK_BEGIN \ DECLARE_IPTR(info); \ info = GET_INFO(updclosure); \ AWAKEN_BQ_NOLOCK(info,updclosure); \ updateWithIndirection(info, INFO_PTR(stg_IND_info), \ updclosure, \ - heapptr,); + heapptr,); \ + BLOCK_END # endif #else