How to prevent expansion of __FILE__ and __LINE__

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

How to prevent expansion of __FILE__ and __LINE__

by Leonid.Kogan :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

Hi

 

I am trying to define a macro in an interface file that uses __LINE__ and __FILE__. Unfortunately, SWIG expands __LINE__ and __FILE__ when it generates .cxx file. As the result line shows the location of the macro in the interface file and file expands to an interface file name. The intent is to pass __LINE__ and __FILE__ as is in a .cxx file and let C++ compiler to the job of __LINE__ and __FILE__ expansion.

 

Is it possible to achieve?

 

Thanks

Leonid Kogan


-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Swig-user mailing list
Swig-user@...
https://lists.sourceforge.net/lists/listinfo/swig-user

Re: How to prevent expansion of __FILE__ and __LINE__

by wsfulton :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Leonid.Kogan@... wrote:

> Hi
>
>  
>
> I am trying to define a macro in an interface file that uses __LINE__
> and __FILE__. Unfortunately, SWIG expands __LINE__ and __FILE__ when it
> generates .cxx file. As the result line shows the location of the macro
> in the interface file and file expands to an interface file name. The
> intent is to pass __LINE__ and __FILE__ as is in a .cxx file and let C++
> compiler to the job of __LINE__ and __FILE__ expansion.
>
>  
>
> Is it possible to achieve?
>

Can you give an example? I put together an example and that works fine.

William

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Swig-user mailing list
Swig-user@...
https://lists.sourceforge.net/lists/listinfo/swig-user