How to use gcc extension attributes with swig

View: New views
3 Messages — Rating Filter:   Alert me  

How to use gcc extension attributes with swig

by Rohit Garg-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I know that the subject is somewhat confusing as SWIG generates
wrappers for ANSI c/c++. But I really need them. The only one I am
using is the __attribute__((alignment(16))) extension so that my data
can be safely used with sse extensions. And that too only with private
variables. Googling for 'swig alignment' or 'swig data alignment' did
not fetch useful results.

I am sure many people here have had same/similiar needs in the past.
Any help will be greatly appreciated.

Thanks in advance.

--
Rohit Garg

http://rpg-314.blogspot.com/

Senior Undergraduate
Department of Physics
Indian Institute of Technology
Bombay

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Swig-user mailing list
Swig-user@...
https://lists.sourceforge.net/lists/listinfo/swig-user

Re: How to use gcc extension attributes with swig

by Josh Cherry :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



On Tue, 23 Sep 2008, Rohit Garg wrote:

> I know that the subject is somewhat confusing as SWIG generates
> wrappers for ANSI c/c++. But I really need them. The only one I am
> using is the __attribute__((alignment(16))) extension so that my data
> can be safely used with sse extensions. And that too only with private
> variables. Googling for 'swig alignment' or 'swig data alignment' did
> not fetch useful results.

What do you mean by "use"?  You may just need for SWIG to ignore them.
You should be able to accomplish this by feeding SWIG a macro definition
of __attribute__() that turns into nothing.

Josh


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Swig-user mailing list
Swig-user@...
https://lists.sourceforge.net/lists/listinfo/swig-user

Re: How to use gcc extension attributes with swig

by Rohit Garg-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> What do you mean by "use"?  You may just need for SWIG to ignore them. You
> should be able to accomplish this by feeding SWIG a macro definition of
> __attribute__() that turns into nothing.

I meant that SWIG is giving an error wherever these are present. So I
can't "use" them. Thanks for your input though. I understand that the
swig macros just run on the header file which is parsed by swig and
can be used to feed a modified form of header file than what was
written. Is that correct?

--
Rohit Garg

http://rpg-314.blogspot.com/

Senior Undergraduate
Department of Physics
Indian Institute of Technology
Bombay

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Swig-user mailing list
Swig-user@...
https://lists.sourceforge.net/lists/listinfo/swig-user
LightInTheBox - Buy quality products at wholesale price!