I am migrating a project from Linux to Xcode and I encountered a “version” problem..
I need a unique identifier at compile time for my dynamic stuff, on linux I was using the __ COUNTER__ preprocessor, but it seems that the gcc 4.2 used in Xcode doesn’t know about __ COUNTER__ yet…
So, I was wondering what I could do to solve this?
I can upgrade the GCC to 4.3(which understands __ COUNTER__), by using the macports.org or something like that… I am very noob on OSX and not very good on linux =[
or find another way to accomplish this, in the case, a method to give the function/variable an unique identifier. I tried with __ LINE__ but after few days, you end up declaring stuff on the same line on different files, and playing with that is just not that produtive…
Any help is appreciated!
Thanks,
Jonathan
@stinky472: I use a code close to what you wrote above…
My problem was that I was using a macro to declare the namespaces of a project, so by that, having the fullname of the class, like class c is in a::b::c.
What I did was changing my code to not rely on the namespaces itself, but add a new argument at the class macro declaration to tell what namespace it is using, like:
newclass(a::b, c): public d{
};
my problem with counter was that the namespaces were being used on lots of classes, thus, creating the same variable name within the namespaces macros, and by using the new way above, I don’t need the counter anymore…
thanks for the help,
Jonathan