FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora Development

 
 
LinkBack Thread Tools
 
Old 11-10-2008, 11:30 AM
Miloslav Trmač
 
Default Note for packagers whose packages need swig

Adam Tkac p*še v Po 10. 11. 2008 v 14:09 +0100:
> there is long standing problem with SWIG when you are wrapping around
> C code and use system headers. SWIG doesn't define "standard" C
> preprocessor macros.
>
> I think every
> maintainer should check his package and if it uses system C headers he
> should add this to .i file (SWIG template)
>
> $ cpp -dM /dev/null | grep -v __STDC__ > cpp_macros.h # SWIG defines __STDC__ macro
>
> and then add '%include "cpp_macros.h" to top of .i file
Is there any reason not to use %import instead? AFAICS the macros still
work in #ifdefs, but they are not added to the generated file.
Mirek

--
fedora-devel-list mailing list
fedora-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-devel-list
 
Old 11-10-2008, 12:09 PM
Adam Tkac
 
Default Note for packagers whose packages need swig

Hi all,

there is long standing problem with SWIG when you are wrapping around
C code and use system headers. SWIG doesn't define "standard" C
preprocessor macros. Due this it might happen that wrapped code uses
wrong data types, wrong function prototypes etc. There is bug about
this problem in upsteam bugzilla
(http://sourceforge.net/tracker/?func=detail&atid=101645&aid=1604332&group_id=1645 )
but upsteam is not going to fix it.

List of packages whose use SWIG and their maintainers is on
http://atkac.fedorapeople.org/packages_needs_swig. I think every
maintainer should check his package and if it uses system C headers he
should add this to .i file (SWIG template)

$ cpp -dM /dev/null | grep -v __STDC__ > cpp_macros.h # SWIG defines __STDC__ macro

and then add '%include "cpp_macros.h" to top of .i file

After that you can be sure that wrapped code uses correct data sizes.
Feel free to ask me if you have any question.

Regards, Adam

--
Adam Tkac, Red Hat, Inc.

--
fedora-devel-list mailing list
fedora-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-devel-list
 
Old 11-10-2008, 12:36 PM
Adam Tkac
 
Default Note for packagers whose packages need swig

On Mon, Nov 10, 2008 at 01:30:16PM +0100, Miloslav Trmač wrote:
> Adam Tkac p*še v Po 10. 11. 2008 v 14:09 +0100:
> > there is long standing problem with SWIG when you are wrapping around
> > C code and use system headers. SWIG doesn't define "standard" C
> > preprocessor macros.
> >
> > I think every
> > maintainer should check his package and if it uses system C headers he
> > should add this to .i file (SWIG template)
> >
> > $ cpp -dM /dev/null | grep -v __STDC__ > cpp_macros.h # SWIG defines __STDC__ macro
> >
> > and then add '%include "cpp_macros.h" to top of .i file
> Is there any reason not to use %import instead? AFAICS the macros still
> work in #ifdefs, but they are not added to the generated file.
> Mirek
>

Yes, %import will be better than %include.

Adam

--
Adam Tkac, Red Hat, Inc.

--
fedora-devel-list mailing list
fedora-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-devel-list
 

Thread Tools




All times are GMT. The time now is 01:30 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org