Welcome! Log In Create A New Profile

Advanced

How can I redefine something without it screwing up?

Posted by pokeglobe 
How can I redefine something without it screwing up?
March 24, 2010 12:42AM
I am trying to define the title ID to install via the Menu selection.

Aka Install With Trucha = Define IOS36
Install Without = Define IOS35

But I cannot use the #define more than once without it screwing with me.

I also cannot use:
INPUT_VERSION= 12;

or it will spew out an error.
error: lvalue required as left operand of assignment

Should I just remove the defines and replace them with int?

Thanks for any help!
Re: How can I redefine something without it screwing up?
March 24, 2010 01:02AM
static
Re: How can I redefine something without it screwing up?
March 24, 2010 01:55AM
#define XYZ (1)

#undef XYZ

#define XYZ (2)
Re: How can I redefine something without it screwing up?
March 25, 2010 09:10AM
#ifdef XYZ
#undef XYZ
#define XYZ whatever
#endif
Re: How can I redefine something without it screwing up?
March 28, 2010 12:38AM
Or heaven forbid, use a variable. That's what it's meant for, something that changes, AKA variable

so yes static int input_version;

And then assign input_version when you need to.
Re: How can I redefine something without it screwing up?
March 28, 2010 01:44AM
Hi Tantric. I noticed that you use static global variables in some of your libwiigui cpp files (thanks for the great library!). This uses internal linkage and thus helps prevent name clashes, but before encouraging other people to use static, I just wanted to mention that the C++ standard now recommends using namespaces to prevent name clashes. I personally feel namespaces are overlooked too often, and would like to encourage library authors to use them.
Sorry, only registered users may post in this forum.

Click here to login