[aspectc-user] __declspec issues

John Hawkins HAWKINSJ at uk.ibm.com
Wed Aug 18 16:59:57 CEST 2004




Hmm, I got to get this working in opensource so purchased products aren't
in the picture :-(

However, I got this working (at some level) by using the --vc option
(thanks to Matthias Urban <matthias.urban at pure-systems.com> ) and then I
had to use the --problem flag (don't really know what it does but it got
rid of some more errors that I was having with "string"

I've still got issues with other stuff and I think I mailed Matthias
directly by mistake so hopefully he'll copy everyone on the reply if it
helps anyone else !


John Hawkins




                                                                           
             Daniel Lohmann                                                
             <daniel.lohmann at i                                             
             nformatik.uni-erl                                          To 
             angen.de>                 John Hawkins/UK/IBM at IBMGB           
                                                                        cc 
             18/08/2004 15:04          aspectc-user at aspectc.org            
                                                                   Subject 
                                       Re: [aspectc-user] __declspec       
                                       issues                              
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           





Hi John,


Most of the MS-specific language extensions are only parsed correctly
with the commercion version of ac++.exe, which is developed and sold by
pure-systems GmbH (http://www.pure-systems.com/) as part of their
VisualStudio AddIn.

As a workaround you may use "#ifdef __puma" which is defined during
parsing and weaving:

#ifdef __puma
    #define STORAGE_CLASS_INFO
#else
    #define STORAGE_CLASS_INFO __declspec(dllexport)
#endif

or, as a more general solution

#ifdef __puma
    #define __declspec(some_argument)
#endif


Have fun!

Daniel



John Hawkins wrote:

>I'm trying to make ac++ trace sample work against a "simple" class.
>However, the class has the following code snippet in one of its included
>headers ->
>
>"STORAGE_CLASS_INFO int initialize_module(int bServer);"
>
>where STORAGE_CLASS_INFO is a macro for "__declspec(dllexport)" (a windows
>specific api.)
>
>I'm getting the error -> error: invalid declaration near token `int'
>
>Why? I can only assume there is something wrong with ac++ handling of
>__declspec(dllexport)- but what?
>It's not an issue with the macro substitution because I have hardcoded it
>and still get the same error but i left it in for completeness incase
>someone knows otherwise.
>
>Compiler is MS VC6.0 (Yes, I know there are supposed to be issues but I
>only want to use it for trace at the moment so thought I could get away
>with it !)
>
>
>






More information about the aspectc-user mailing list