Inline functions and conditional compiling in VB.NET or C#?

Does VisualBasic.NET or C# support conditional compiling? And inline functions (macros)?

When I talk about conditional compiling, I mean something like C/C++, where you do:

#ifdef DEBUG
    my_var = call_some_debug_function();
#else
    my_var = call_some_final_function();
#endif

And in the resulting compiled code, there is only the call to the call_some_debug_function or the call_some_final_function.

When I talk about inline functions, I mean something like C/C++ macros:

#define sum(a, b) a + b
...
total = sum(a, b)

And the resulting compiled code is:

total = a + b

Are these constructions supported by any of these .NET languages?

Jon Skeet
people
quotationmark

Conditional compilation is supported by both C# and VB:

C#:

#if DEBUG
   Foo();
#else
   Bar();
#endif

VB:

#If DEBUG Then
   Foo
#Else
   Bar
#End If

Macros are not supported in C# or VB as far as I'm aware... typically inlining is left to the JIT compiler.

people

See more on this question at Stackoverflow