If you get override errors, you must define the macro more than once. If this code is the only place where DOMAIN
and DOMAINCOMET
, then it is possible that both of your control DOMAINCOMET
set.
This can happen if both __PRODUCTION
and __LIVE_TESTING
defined for any value - even 0, since you use #ifdef
to determine if they are defined, and not test the actual value that they are assigned.
For example, even:
#define __PRODUCTION 0 #define __LIVE_TESTING 1
will cause both blocks to be evaluated according to your code and thus cause an override error.
If you want these two to be mutually exclusive, you should check their meaning in this way:
#if __PRODUCTION==1 #define DOMAIN @"http://192.168.10.228/rest/" #define DOMAINCOMET @"http://192.168.10.228/" #elif __LIVE_TESTING==1 #define DOMAIN @"http://192.168.10.229/rest/" #define DOMAINCOMET @"http://192.168.10.229/" #endif
source share