[aspectc-user] __declspec issues

John Hawkins HAWKINSJ at uk.ibm.com
Fri Aug 20 20:54:51 CEST 2004




Hi again,

OK, I've got the gist of what's going wrong but losing the plot as to how
to fix it.
I've currently got the following options (on the command line) ->
-D_WIN32
-DWIN32
-D_WINDOWS
-D_MBCS
-D__cplusplus
-I%compilerincludedir%
-v9
--problem_local_class
-A machine(i386)
-A platform(win32)
--vc
-D_USRDLL

NOTE: "-A platform..." is spelt "-A plattform" in the sample conf file
(issue?)

I'm getting the following errors -

c:/progra~1/micros~2/vc98/include/winnt.h:630: error, Must define a target
architecture.
c:/progra~1/micros~2/vc98/include/stdio.h:77: error: `signed' or `unsigned'
invalid for given type
c:/progra~1/micros~2/vc98/include/winnt.h:22: error: invalid declaration
near token `"C"'
  - Aborting

Now, I can see these errors but can't work out why it needs me to define a
target architecture - When I compile my code using MSVC or ant (using MSVC)
I don't see any flags to indicate target architecture

This must be another one of my dumb errors - so can you point me in the
right direction please?

thankyou,
John.







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




John Hawkins wrote:

>
>
>Yep, that's the code alright :-((
>
>This is going to scupper the Axis C++ projects use of AspectC++ in that
>case (very sad :-(
>
>If I create  bug report what's the next step -  are you guys working on
>this stuff permanently, would you ignore this because it's a v 6.0 issue
>(don't know if it's a v7 issue)?
>
>

John,

As the weaver is complaining about the line, I doubt that this is a VC6
specific issue.

RPC_ENTRY is defined as __stdcall, RPC_STATUS as long and IN/OUT are
just for documentation purposes and defined as nothing, so the line

typedef RPC_STATUS RPC_ENTRY
RPC_IF_CALLBACK_FN (
     IN RPC_IF_HANDLE  InterfaceUuid,
     IN void *Context
     ) ;

expands to

typedef long __stdcall
RPC_IF_CALLBACK_FN (
      RPC_IF_HANDLE  InterfaceUuid,
      void *Context
     ) ;


which should not result in any weaving problems.
I was not able to reproduce your problem, regardless of using the free
or commercial edition, VC6 headers or newer ones from the PlatformSDK.
I tried the following test application and did not encounter any problems:

// main.cpp
#include <stdio.h>
#include <windows.h>
#include <rpcdce.h>
int main() {

    printf( "Hello from main!\n" );
    return 0;
}

// aspect.ah
#include <stdio.h>
aspect Hello {
    advice execution( "% main(...)" ) : before() {
        printf( "Hello from Aspect :-)\n" );
    }
};

This all makes me believe that the real problem is somewhere else and
for some reason not detected/reported earlier during the weaving process.
Maybe you can track down the thing to a smaller test app so we can
reproduce it?

Regards

Daniel



>Does the corresponding source code look like this?
>
>
>typedef RPC_STATUS RPC_ENTRY
>RPC_IF_CALLBACK_FN (
>     IN RPC_IF_HANDLE  InterfaceUuid,
>     IN void *Context
>     ) ;
>
>
>If so, I also can't say what's going wrong. It can only be that
>RPC_STATUS and RPC_ENTRY resolve to nothing (which is a syntax error in
>C++) or IN resolves to something MS specific that our parser doesn't
>understand.
>
>
>Matthias
>
>--
>Matthias Urban                          Phone: +49-391-544569-32
>pure-systems GmbH                       Fax:   +49-391-544569-90
>
>
>
>_______________________________________________
>aspectc-user mailing list
>aspectc-user at aspectc.org
>http://www.aspectc.org/mailman/listinfo/aspectc-user
>
>
>






More information about the aspectc-user mailing list