[Date Prev][Date Next][Thread Prev][Thread Next][Thread Index]

RE: [XaraXtreme-dev] includes, XARLIB and camtypes.h



Gerry,

--On 09 June 2006 10:08 +0100 Gerry Iles <GerryI@xxxxxxxx> wrote:

Well, the reason for the conditional in camtypes.h is so that XarLib can
use the same source as XaraLX without having to ship all of the headers
that aren't actually needed by the code that is included in XarLib.  If
we change the headers so that all the content is conditional then the
XarLib source package would still need to include lots of files that are
effectively blank.

Is the conditional bit itself causing trouble for your script or is this
more a potential problem that might crop up in the future?  Do you have
some specific changes in mind that you think might break XarLib?

The source for XarLib consists of a subset of the XaraLX files
(camtypes.h, some from wxOil and some from Kernel) and a few other files
in another subfolder that appears before the others in the include order
(some are replacements for XaraLX files that would require too much
conditional code and some are new files that provide the XarLib API).

It is possible to include alternate versions of headers in this other
subfolder (as is currently done with camelot.h and ensure.h) but I don't
really want to include a whole spate of empty replacement headers.

I don't think there is going to be a big problem assuming those headers
that are part of XarLib are included outside the conditional bit in
camtypes.h so I'll move those newly added includes that are part of
XarLib to outside the #ifndef so that source files that are part of
XarLib that you have removed includes from (and moved them to
camtypes.h) still build as part of XarLib.

It's not the conditional itself that is causing the problem. Let's
say foo.h in included in camtypes, but inside the conditional.
If bar.cpp currently includes foo.h, and I remove that include,
then bar.cpp (which needs foo.h) will not compile with XARLIB defined.

However, if you have excluded those files precisely because XarLib
doesn't include them anyway, then bar.cpp wouldn't have compiled
anyway (as the file would have been missing). So we've lost nothing.

Agree?

The only danger is if you put something INSIDE the conditional which IS
used by XARLIB. Were those the ones you were proposing to move? In which
case yes that should fix it.

Alex