Reputation: 93
#ifdef WIN32
# define TARGET_OS 'W_NT'
I am getting C++ warning in Linux multi-character character constant. at the below line. How to resolve this warning.
#if TARGET_OS == 'W_CE'
Upvotes: 0
Views: 5697
Reputation: 143249
String constants use double quotes, single quotes are for character constants.
To suppress the warning if this is what you mean you can use -Wno-multichar
gcc option.
Upvotes: 3
Reputation: 1
Don't define preprocessor constants as strings or chars when testing them in #if
. Perhaps coding
#if TARGET_OS_IS_WIN_NT
/* do something for Windows NT */
#endif
#if TARGET_OS_IS_LINUX
/* do something for Linux */
#endif
Better yet, consider using multi-system libraries like e.g. Qt -they did all the boring job of handling system specific things and provide you with a nice common API.
Upvotes: 1