I have a an application header file in c where I mention the variable.
#VAR_X "testData"
User can change this variable but I want to restrict it's length to maximum of 50.If user tries to make it more than 50 there should be an error on building the code.
I have done like this in the application.h:
#define __IS_MORE if((strlen(VAR_X) - 50) > 0) 1:0;
and in application.c at the top .
#define application.h
#if defined(__IS_MORE)
#error "Size is more than the maximum size"
#endif
But no matter what I put in the VAR I always get the #error directive "Size is more than the maximum size"
What wrong I am doing?