473,386 Members | 1,715 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

code after preprocessor / macro

Hi,
I have written C# code. And I have used preprocessor / macro in it.

I want to get the C# code after processing preprocessor, I have defined
durcng compile time. How can I get this code?

Is there any csc compiler option, that can produce the code after processing
the macros/preprocessors?

Thank you,
Avin Patel
Nov 16 '05 #1
3 2005
Avin Patel <Av*******@discussions.microsoft.com> wrote:
I have written C# code. And I have used preprocessor / macro in it.

I want to get the C# code after processing preprocessor, I have defined
durcng compile time. How can I get this code?

Is there any csc compiler option, that can produce the code after processing
the macros/preprocessors?


No - C# doesn't *have* macros or a preprocessor. It has "pre-processing
directives" which are named that way because they look similar to C/C++
ones, but there's no actual pre-processor.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #2
Hi,
Well, It doesn't matter, What you call? MACRO, preprocessor or
*pre-processor directive* Or act like preprocessor. In the end it does the
same job as the C++ pre-processor does.

So my question is, How can I get the C# code after compiler has done
processing this "pre-processor"?
As the C++ compiler has the facility to obtain the C++ code after compiler
has done pre-processing.

Thank You,
Avin Patel

"Jon Skeet [C# MVP]" wrote:
Avin Patel <Av*******@discussions.microsoft.com> wrote:
I have written C# code. And I have used preprocessor / macro in it.

I want to get the C# code after processing preprocessor, I have defined
durcng compile time. How can I get this code?

Is there any csc compiler option, that can produce the code after processing
the macros/preprocessors?


No - C# doesn't *have* macros or a preprocessor. It has "pre-processing
directives" which are named that way because they look similar to C/C++
ones, but there's no actual pre-processor.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too

Nov 16 '05 #3
Avin Patel <Av*******@discussions.microsoft.com> wrote:
Well, It doesn't matter, What you call? MACRO, preprocessor or
*pre-processor directive* Or act like preprocessor. In the end it does the
same job as the C++ pre-processor does.
Not quite - because there's no separate pre-processor step.
So my question is, How can I get the C# code after compiler has done
processing this "pre-processor"?
It doesn't go from non-pre-processed code to pre-processed code.
There's no extra step.
As the C++ compiler has the facility to obtain the C++ code after compiler
has done pre-processing.


That's because C++ has a pre-processor. C# doesn't.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

24
by: Nudge | last post by:
I have an array, and an unrolled loop which looks like this: do_something(A); do_something(A); .... do_something(A); I thought: why should I type so much? I should write a macro. So I was...
16
by: Trying_Harder | last post by:
Is it possible to redefine a macro with global scope after undefining it in a function? If yes, could someone explain how? /If/ my question above isn't very clear you can refer to the...
3
by: Charlie Zender | last post by:
Hi, I want to have a CPP macro that tests the value of a token and returns the string "No" if the token is undefined (or 0) and returns "Yes" if the token is defined (non-zero). Then I can...
0
by: | last post by:
Hi, I want to find out how much time is spent in macro-code, without having to change all macro-definitions to include some tracking code. Thus when compiling a file, the preprocessor would...
3
by: micromysore | last post by:
Hi, I want to post some code which has defn like struct AVPicture { int *data; int linesize; } the is noe recognised by matlab, so i need to port to some form like struct AVPicture { int...
2
by: Paolo | last post by:
I imported a VC++6.0 project into VC++7.1. The conversion operation makes a mess with Preprocessor Definitions, adding a "$(NoInherit)" for each file. For example: I had a DLL project in VC++6.0...
8
by: claus.tondering | last post by:
I need to write a macro that inserts someStruct m_someStruct; into another struct declaration. The problem is that if the programmer specifies one particluar struct (called alpha), nothing...
6
by: Subra | last post by:
Hi, Compilation of the below code fails #define a this1, /* Comma is intentional line 1*/ #define fun( x, y, z) y*x*z/*line 2*/ char this1,b,c;/*line 3*/
3
by: qianz99 | last post by:
Hi I am not sure what this code does. I have the following questions 1. where is the case? 2. #define TLV_INTEGER(name, octets) p->name = -1; Is it define a function TLV_INTEGER(name, octets) ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.