NO

Author Topic: #ifdef in RC file  (Read 3267 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: 2113
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 »
"It is better to be hated for what you are than to be loved for what you are not." - Andre Gide