VS Error from macro AudioMemory(num) in AudioStream.h

Status
Not open for further replies.

CraigF

Well-known member
Visual Studio / Visual Micro give an error when attempting to use the macro

Code:
AudioMemory(60);

The error message is "Expression expected" and the cause of the error is the parentheses wrapped around the macro definition found in file AudioStream.h as follows:

Code:
#define AudioMemory(num) ({ \
	static DMAMEM audio_block_t data[num]; \
	AudioStream::initialize_memory(data, num); \
})

Removing the outer parentheses resolves the error message.

My question: is it OK to just remove the parentheses in the library header file, or would that break something somewhere else?

Would I be better off to just put the inner code in my program explicitly?

thanks!

-- Craig
 
My question: is it OK to just remove the parentheses in the library header file, or would that break something somewhere else?

Probably fine to delete the parens.

Would I be better off to just put the inner code in my program explicitly?

That should work too, but don't name anything else "data" within its scope.
 
Status
Not open for further replies.
Back
Top