Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2005-06-10 15:35:23

Disclaimer: I didn't write this stuff and I've never run it.

Larry Evans <cppljevans_at_[hidden]> writes:

> On 06/10/2005 01:07 PM, David Abrahams wrote:
>> Larry Evans <cppljevans_at_[hidden]> writes:
> [snip]
>>>authors. What I need to do is change:
>>> vectorX_c< T,C0 >
>>> vectorX_c< T,T(C0) >
>>>for each X=1...
> [snip]
>> In libs/mpl/preprocessed/ do
>> python
>> And it should tell you everything you need to know.
> Thanks David. This gave me:
> <----- cut here -----
> Usage:
> <mode> <boost_root> [<source_file>]
> Purpose:
> updates preprocessed version(s) of the header(s) in
> "boost\mpl\aux_\preprocessed" directory
> Example:
> the following command will re-generate and update all 'apply.hpp' headers:
> all f:\cvs\boost apply.cpp
>>----- cut here -----
> However, despite what the subject line says, what I really need
> is some way to do what's describe in the part of my post
> quoted up above.

You mean you want to change some of the code that is generated by the
preprocessor? You have to figure that out by finding the source file
that generates it. I'm guessing boost/mpl/vector/aux_/numbered.hpp.
Then you edit it.

You can test your changes by compiling with
change directly. Then you can try the ideas below to generate new
preprocessed headers.

> The code in doesn't help much.
> It includes:
> os.system( "preprocess %s %s %s %s" % ( boost_root, mode, file,
> file_path ) )
> which, I assume, invokes the:
> preprocess.cmd
> in that directory. I'm assuming the extension, 'cmd' is some windows
> convention indicating an executable file since the above os.system call
> above didn't include the extension. Since I'm on linux, this wouldn't
> work, AFAICT. I did try:
> <---- cut here ------
> python msvc70 /home/evansl/prog_dev/boost-cvs/ro/boost
> apply.cpp
> sh: line 1: preprocess: command not found
> Traceback (most recent call last):
> File "", line 78, in ?
> , "boost\\mpl\\aux_\\preprocessed"
> File "", line 68, in main
>>---- cut here ------

> I've also searched the file for clues by searching for 'template';
> however, that wasn't much help either.

Why would you expect to find 'template?'

> I'd appreciate any other suggestions for a linux user ;)

I would:

   change the script to write '#!/bin/sh\n' into the beginning of
   preprocess.cmd when not on Windows

   change the script to set the mode on "preprocess.cmd" to +x after
   writing it

   change the os.system call to say "preprocess.cmd"


Dave Abrahams
Boost Consulting

Boost list run by bdawes at, gregod at, cpdaniel at, john at