News for hackers. Stuff that matters.
Re:Linus Torvalds on C++ by Nick_C on Wednesday February 29, 2012 @08:11PM (#3650524)
I'm interested in your comment about m4. I've never really used it except for sendmail configuration. The idea of using it to pre-process namespaces is interesting.

Would you mind expanding on how you set things up and what you do to use m4?

Re:Linus Torvalds on C++ by muyuu on Monday March 05, 2012 @09:07AM (#3666502)
Sorry for not responding to this earlier, I just missed it.

In m4 I simply created some sort of preprocessor that renamed variables to have some sort of prefix depending on namespace. I haven't used this for a good while because then I have the issue that MSVC doesn't support other modern C99 things that I consider basic unless you compile in C++ mode, thus negating this. At work I need MSVC compatibility...

Hope you get to read this.

If I were to do this again today, I'd use OMeta. Give it a look, it's dead simple if you have the time to read through it.