
I've ported the preprocessor library to the Digital Mars preprocessor. The patch is at: http://myweb.tiscali.co.uk/calamity/patches/preprocessor-1.patch.gz With it, the only test which doesn't pass is the BOOST_PP_LINE test in debug.cpp, because the preprocessor has problems with macro expansion in #line statements. Would it be possible to add this to CVS after the release? Unless I've made a mistake, it won't interfere with any other preprocessors. The patch works around two bugs in the preprocessor. First, in a statement like this: #define FOO(pred, x) BAR(pred(x)) pred(x) won't get expanded. There are several ways to work around this, the one I've mostly used is to write: #define FOO(pred, x) BAR(pred##(x)) You can also use: #define CALL(pred, x) pred(x) #define FOO(pred, x) BAR(CALL(pred, x)) And, with the patch: #define FOO(pred, x) BAR(BOOST_PP_EXPAND(pred(x))) But, I think those two could cause problems with recursion. The other bug is with the preprocessors handling of whitespace. In the following example, neither concatenations work, both give '1 1' instead of '11'. #define EMPTY #define TRAILING_WHITESPACE(x) x EMPTY #define LEADING_WHITESPACE(x) EMPTY x BOOST_PP_CAT(TRAILING_WHITESPACE(1), 1) BOOST_PP_CAT(1, LEADING_WHITESPACE(1)) This causes subtle bugs with macros like this: #define BOOST_PP_LESS(x, y) BOOST_PP_IIF( \ BOOST_PP_NOT_EQUAL(x, y), \ BOOST_PP_LESS_EQUAL, 0 BOOST_PP_TUPLE_EAT_2)(x, y) This leaves a white space after the 0 when x and y are equal which prevents concatenation. This is mainly a problem with BOOST_PP_WHILE, BOOST_PP_FOLD_LEFT etc. It is possible to remove the whitespace by concatenating it to a macro which expands to nothing, but that is only possible when you know that there is definitely going to be whitespace. thanks, Daniel

I've ported the preprocessor library to the Digital Mars
"Daniel James" <daniel@calamity.org.uk> wrote in message news:pan.2004.07.31.13.50.45.178006@calamity.org.uk... preprocessor. The
patch is at:
http://myweb.tiscali.co.uk/calamity/patches/preprocessor-1.patch.gz
With it, the only test which doesn't pass is the BOOST_PP_LINE test in debug.cpp, because the preprocessor has problems with macro expansion in #line statements.
This is qute an achievement! Congratulations. If the preprocessor library works, a lot of the rest of boost should compile. Have you tried to use type traits and mpl? Jonathan

Jonathan Turkanis writes:
I've ported the preprocessor library to the Digital Mars
"Daniel James" <daniel@calamity.org.uk> wrote in message news:pan.2004.07.31.13.50.45.178006@calamity.org.uk... preprocessor. The
patch is at:
http://myweb.tiscali.co.uk/calamity/patches/preprocessor-1.patch.gz
With it, the only test which doesn't pass is the BOOST_PP_LINE test in debug.cpp, because the preprocessor has problems with macro expansion in #line statements.
This is qute an achievement! Congratulations.
If the preprocessor library works, a lot of the rest of boost should compile.
Regression tests are the best way to see how much work is left. Anyone interested in setting them up? The setup instructions are available at http://www.meta-comm.com/engineering/regression_setup/instructions.html and the Digital Mars/STLPort toolset is documented here -- http://www.boost.org/tools/build/v1/dmc-stlport-tools.html.
Have you tried to use type traits and mpl?
FYI, the new version of MPL will play much nicer with the latest Digital Mars. -- Aleksey Gurtovoy MetaCommunications Engineering

Aleksey Gurtovoy wrote:
and the Digital Mars/STLPort toolset is documented here -- http://www.boost.org/tools/build/v1/dmc-stlport-tools.html.
Thanks for adding that, it'll make life a lot easier. Jonathan Turkanis writes:
Have you tried to use type traits and mpl?
Not until today. I've attached a patch for a couple of changes to type traits. It's not really ready to be added to CVS, I've just arrived at it through trial and error. But it should help anyone else who wants to work on Digital Mars. Aleksey Gurtovoy wrote:
FYI, the new version of MPL will play much nicer with the latest Digital Mars.
That's a relief, getting MPL to work looks hard. thanks, Daniel

"Daniel James" <daniel@calamity.org.uk> wrote in message news:ceiqfn$gmh$1@sea.gmane.org...
Jonathan Turkanis writes:
Have you tried to use type traits and mpl?
Not until today. I've attached a patch for a couple of changes to
type
traits. It's not really ready to be added to CVS, I've just arrived at it through trial and error. But it should help anyone else who wants to work on Digital Mars.
You should post an announcement at the digital mars c++ list (news.digitalmars.com), if you haven't already done so. Jonathan

"Daniel James" <daniel@calamity.org.uk> wrote:
I've attached a patch for a couple of changes to type traits.
Don't use this patch, it's very wrong. Sorry. Jonathan Turkanis wrote:
You should post an announcement at the digital mars c++ list (news.digitalmars.com), if you haven't already done so.
I'll put together something better later on today, and post it there. Thanks for letting them know about this. Daniel

Daniel James writes:
I've ported the preprocessor library to the Digital Mars preprocessor. The patch is at:
http://myweb.tiscali.co.uk/calamity/patches/preprocessor-1.patch.gz
With it, the only test which doesn't pass is the BOOST_PP_LINE test in debug.cpp, because the preprocessor has problems with macro expansion in #line statements.
Daniel, this is an impressive piece of work, and a valuable contribution!
Would it be possible to add this to CVS after the release? Unless I've made a mistake, it won't interfere with any other preprocessors.
Tested locally and committed, with Paul's consent. Thank you! -- Aleksey Gurtovoy MetaCommunications Engineering
participants (3)
-
Aleksey Gurtovoy
-
Daniel James
-
Jonathan Turkanis