Take out ##. This is to create a new token from two tokens; but you are not doing it here, you really just want two tokens.
Also, you cannot use the same name for a variable as for a macro parameter.
, . , :
#define DECLARE_BUFFER(size_, name) \
struct { \
unsigned short readIndex;
unsigned short writeIndex;
unsigned char dataPtr[size_]; \
} name = { 0 }
BUFFER(10, buffer10bytes);
BUFFER(50, buffer50bytes);
size, : sizeof X.dataPtr, . (: Ptr - ). size, ( Remy ), , - :
#define DECLARE_BUFFER(size_, name) \
struct { \
unsigned short size;
unsigned short readIndex;
unsigned short writeIndex;
unsigned char dataPtr[size_]; \
} name = { size_, 0 }