This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Macro fails at compile

Hello,

I am creating the MAKELONG, HIWORD, LOWORD like in Window's C programming.

However, when I create the macro's below I get the error message that follows.

Anyone have any suggestions on why ARM is complaining? I've never had an issue with standard C with this type of macro before.

I thought that maybe the compiler did not know what type of variable "val" was, so I defined the variable in the macro (long val) but that did not help either.

#define MAKELONG (x,y) ((((x) << 16) & 0xFFFF0000) + (y))
#define LOWORD (val) ((val) & 0xFFFF)
#define HIWORD (val) (((val) >> 16) & 0xFFFF)

Source\message.c(23): error: #20: identifier "x" is undefined
Source\message.c(23): error: #20: identifier "y" is undefined

Usage of macro:

        lCmd = MAKELONG ((0xFFF1), (0x111F));

0