NO

Author Topic: #ifdef in RC file  (Read 499 times)

Grincheux

  • Guest
#ifdef in RC file
« 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!

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 1597
Re: #ifdef in RC file
« Reply #1 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
« Last Edit: February 27, 2016, 03:12:17 pm by frankie »