[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: #define conflict with swig
From: |
Jon H. Davis |
Subject: |
Re: #define conflict with swig |
Date: |
Sun, 21 Aug 2005 14:27:56 -0400 |
On Sun, 2005-08-21 at 13:20 -0400, John W. Eaton wrote:
> On 21-Aug-2005, jon wrote:
>
> | I've been attempting to embed both octave and python in a third program
> | using the swig interface generator. Using the usual oct.h includes in
> | an octave.i
> | file, I get
> |
> | address@hidden:~/develop/octave-py $ swig -c++ -python octave.i
> | octave/config.h:768: Error: Macro 'DYNAMIC_CAST' redefined,
> | /usr/share/swig1.3/swig.swg:382: Error: previous definition of
> | 'DYNAMIC_CAST'.
> |
> | It appears part of the magic swig does uses DYNAMIC_CAST cleverly,
> | and that
> | collides with octave's version.
> |
> | Is there anything to do other than getting octave sources, and
> | rebuilding after using sed
> | to effect a s/DYNAMIC_CAST/_DYNAMIC_CAST/g on the whole octave source
> | tree ?
> | That would probably work, but make the project unmaintainable.
>
> I used these macros because I wanted to be able to make Octave work on
> systems where the C++ compiler did not yet implement dynamic_cast,
> reinterpret_cast, and static_cast. These days, I think we can assume
> that the C++-style casts will be available in any compiler that is
> capable of compiling Octave. So maybe now would be a good time to
> replace these macros in Octave with the actual C++-style casts in the
> source?
>
> jwe
I don't know enough about C++ compiler variation to comment on
that, although it suggests the same could be said about the swig
sources. I did notice that in the octave headers those *_CAST macros
seem to be effectively no-ops on my systems.
For now, I ran the sed on a private copy of the octave/*.h so I
can try things out. I'm predicting that the main problems are going to
arise from both python and octave doing reference counting. Thanks.
Jon
>
>
>
> -------------------------------------------------------------
> Octave is freely available under the terms of the GNU GPL.
>
> Octave's home on the web: http://www.octave.org
> How to fund new projects: http://www.octave.org/funding.html
> Subscription information: http://www.octave.org/archive.html
> -------------------------------------------------------------
-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.
Octave's home on the web: http://www.octave.org
How to fund new projects: http://www.octave.org/funding.html
Subscription information: http://www.octave.org/archive.html
-------------------------------------------------------------