Pelles C forum

C language => Beginner questions => Topic started by: Grincheux on February 26, 2016, 08:10:02 PM

Title: #ifdef in RC file
Post by: Grincheux on February 26, 2016, 08:10:02 PM
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!
Title: Re: #ifdef in RC file
Post by: frankie on February 27, 2016, 03:07:36 PM
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
Code: [Select]
IDR_ICO_FR_FLAG ICON "French.ico"
IDR_ICO_IT_FLAG ICON "Italia.ico"

A Language def file:
Code: [Select]
#ifdef __FRANCE__
#define IDR_ICO_FLAG IDR_ICO_FR_FLAG
#else
#define IDR_ICO_FLAG IDR_ICO_IT_FLAG
#endif