bugs in cutil.h macro definitions

There are a number of macros in cutil.h and some of the multiline ones are defined in a way that can produce syntax errors when used in a if … else … block. For instance there is

#  define CUFFT_SAFE_CALL( call) {                                            \

    cufftResult err = call;                                                    \

    if( CUFFT_SUCCESS != err) {                                                \

    fprintf( stderr, "CUFFT error in file '%s' in line %i.\n",         \

    __FILE__, __LINE__);                \

    exit(EXIT_FAILURE);                                                               \

    } }

and if it is used as

if( something )

    CUFFT_SAVE_CALL( call );

else

    something else

will give a syntax error. The usual way to define multistatement macros is to wrap it in a do{ … }while(0) block which doesn’t have the above problem.

You’re right, thanks. We’ll fix this in our next release.