1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

C/C++ Macros

Discussion in 'C++' started by rodrigo555roro, Apr 21, 2009.

  1. rodrigo555roro

    rodrigo555roro New Member

    Joined:
    Apr 21, 2009
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    I have a macro that looks like:

    #define STUB_OS_API_CALLS

    #ifndef
    STUB_OS_API_CALLS
    #define OSAPICALL(osapifunc) (osapifunc)
    #else
    #include "..\os\vcsupport\include\vcintegrityosstubs.h"
    #define OSAPICALL(osapifunc) (stub_##osapifunc)
    #endif

    when I use the macro as follows:
    eErr = OSAPICALL( Function1(a, b, &c) );

    It has no problem on expanding, however when I try to use the macro inside the first macro as follows:

    eErr = OSAPICALL( Function2(
    OSAPICALL( Function3() ),
    a,
    false,
    b,
    &c) );


    I get a compilation error, saying that OSAPICALL is not defined

    If I dont define STUB_OS_API_CALLS the Macro works just fine using the two statements shown above.

    Can anybody please help me discovering why I can't do this macro when defining STUB_OS_API_CALLS?
     
  2. dharmaraj.guru

    dharmaraj.guru New Member

    Joined:
    Oct 23, 2007
    Messages:
    16
    Likes Received:
    0
    Trophy Points:
    0
    Please provide the prompted error
     

Share This Page