Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
tools
vsnet.act
vsnet.debugging
vsnet.documentation
vsnet.enterprise.tools
vsnet.general
vsnet.ide
vsnet.jlca
vsnet.servicepacks
vsnet.setup
vsnet.vsip
vsnet.vss
vsnet.vstools.office
vstudio.development
vstudio.extensibility
vstudio.general
vstudio.helpauthoring
vstudio.setup
vstudio.sourcesafe
  
 
date: Tue, 18 Mar 2008 07:50:53 +0100,    group: microsoft.public.vstudio.development        back       


How to expand macro line-by-line into a generated preprocessed file ?   
Hello,

The macro looks like:

#define SomeMacro(X) \
    X = X + 10; \
    X = X * 3; \
    X = X + 33; \

The generated preprocessed file looks like:

    Test = Test + 10; Test = Test * 3; Test = Test + 33;

Question:

Is it possible to expand/generate the macro on a line-by-line basis, so it 
looks like:

    Test = Test + 10;
    Test = Test * 3;
    Test = Test + 33;

Maybe via a directive ?

Maybe by modifieing the macro somehow ?

// *** Begin of Example Program ***

#include <stdio.h>

#define SomeMacro(X) \
    X = X + 10; \
    X = X * 3; \
    X = X + 33; \
int main()
{
    int Test;

    Test = 1;

    SomeMacro( Test );

    printf("%d \n", Test );

    return 0;
}

// *** End of Example Program ***

// *** Begin of Generated Preprocessed File ***

int main()
{
    int Test;

    Test = 1;

    Test = Test + 10; Test = Test * 3; Test = Test + 33;;

    printf("%d \n", Test );

    return 0;
}

// *** End of Generated Preprocessed File ***

Bye,
  Skybuck.
date: Tue, 18 Mar 2008 07:50:53 +0100   author:   Skybuck Flying

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us