[C++-sig] Pyste suggestion: MSVC precompiled headers support

Niall Douglas s_sourceforge at nedprod.com
Fri Oct 10 21:14:25 CEST 2003

Hash: SHA1

On 9 Oct 2003 at 20:27, Nicodemus wrote:

> >>Well, this headers are included always first:
> >>
> >><boost/python.hpp>
> >><boost/cstdint.hpp>
> >
> >Err, they're not here. The first include is always the one the 
> >Class() or AllFromHeader() has pulled in, which is invariably not
> >global across all modules.
> Both in single and multiple mode. Can you post your generated code
> where the user's headers are included first?

The pyste file:
from Policies import FX4Splitter
cclass=Class('FX::FX4Splitter', '../include/FX4Splitter.h')
FX4Splitter.apply(globals(), cclass)

The output:

// Includes 
===================================================================#include <../include/FX4Splitter.h>
#include <boost/python.hpp>
#include <../include/fx.h>

// Using 
=====================================================================using namespace boost::python;

// Declarations 
===============================================================namespace TnFOX {

As you can see, the ../include/FX4Splitter.h is before the common 
includes boost/python.hpp and ../include/fx.h.

> >BTW is AllFromHeader() fixed yet?
> >
> No. 8(

Shame. Until it is, my bindings will be only 75% complete.

> Ops, you're right. You suggested CommonInclude, but I think PCHInclude
> would be better, what you think?

Actually yes and I'd make it only permit one file only. Why? Because 
it seems future G++ support will only permit one precompiled header 
file per compilation. See 

Therefore in my example above, we'd need to have one header file 
including everything common to all modules. This will require some 
tweaking on my end (I'll do it tonight).

> Also, I seem to have missed the point
> of your posted #ifdef...

Because #pragma hdrstop won't compile on GCC.

> So, PCHInclude would always include that header first in *all*
> modules, right? Anything else is needed?

Well, you needn't go that far as I and probably most people invoke 
pyste once per .pyste file (not many .pyste files at once). Making 
pyste behave differently with many files and a single file seems 
foolish as my make system only re-pyste's the pyste files which would 
have changed from the headers they include changing. I don't want to 
re-pyste everything with each header file change!


Version: idw's PGP-Frontend / 9-2003 + PGP 8.0.2


More information about the Cplusplus-sig mailing list