News:

Download Pelles C here: http://www.smorgasbordet.com/pellesc/

Main Menu

#ifdef in RC file

Started by Grincheux, February 26, 2016, 08:10:02 PM

Previous topic - Next topic

Grincheux

The rc editor remove the next lines

In commandline parameter __FRANCE__

Quote#ifdef __FRANCE__
IDR_ICO_FLAG ICON "French.ico"
#else
IDR_ICO_FLAG ICON "Italia.ico"
#endif

becomes

Quote
IDR_ICO_FLAG ICON "French.ico"

I have lost the Italian flag definition!
Why!

frankie

#1
Hey you have lost my flag!  >:(

:)

It is not exactly a bug, but the way PellesC works  :'(
After the first compilation from porc util any change made with rc editor modify the rc file removing what it don't understands...

As a workaround you can include all flags and then exchange the one you want in the code.
I.e.
RC file

IDR_ICO_FR_FLAG ICON "French.ico"
IDR_ICO_IT_FLAG ICON "Italia.ico"


A Language def file:

#ifdef __FRANCE__
#define IDR_ICO_FLAG IDR_ICO_FR_FLAG
#else
#define IDR_ICO_FLAG IDR_ICO_IT_FLAG
#endif
"It is better to be hated for what you are than to be loved for what you are not." - Andre Gide