conditional-compilation

project-level conditional compilation constant

I am getting a project-level conditional compilation constant error while trying to build my vb.net project. It reads: project-level conditional compilation constant 'VB_VER=9.0,TARGET="exe",CONFIG="Debug",_MyType="Console",PLATFORM="AnyCPU",DEBUG;^^ ^^ TRACE' not valid: Character is not valid. I recently upgraded it to the latest ve...

What does @cc_on mean in JavaScript?

Sometimes I see @cc_on in JavaScript. What does it mean? ...

Is it possible to conditionally compile to .NET Framework version?

I can recall back when working with MFC you could support multiple versions of the MFC framework by checking the _MFC_VER macro. I'm doing some stuff now with .NET 4 and would like to use Tuple in a couple of spots but still keep everything else 3.5 compatible. I'm looking to do something like: #if DOTNET4 public Tuple<TSource, T...

How do I "White Label" my ASP.Net MVC Application?

I have a "white labelled" application that is installed onto multiple customers' servers. On any given installation the differences will include content, style sheets and graphics but also some actual code / business logic. I want my TFS Server to build all flavours of my application automatically. What are my options for doing this? e.g...

XCode Preprocessor Macro for Configuration?

I want my XCode Objective-C project to be able to detect which configuration it is being built with. How can I achieve this? Thanks in advance. ...

Determining 32 vs 64 bit in C++

I'm looking for a way to reliably determine whether C++ code is being compiled in 32 vs 64 bit. We've come up with what we think is a reasonable solution using macros, but was curious to know if people could think of cases where this might fail or if there is a better way to do this. Please note we are trying to do this in a cross-platfo...

Delphi - Scope of custom definitions

Good Morning, I have a unit which I want to use in two different programs, to tell the difference I wanted to Define a symbol and then check that in the unit. In my DPR for the project I have; program Project1; {$Define MYDEF} uses Forms, ... and in my Form1 file I have procedure TForm1.FormCreate(Sender: TObject); begin {...

.NET Conditional Compiler Symbols and Unit Test Libraries

My team has a set of unit test libraries that run against our application code - unfortunately they are throwing (unexpected) exceptions. The reason for this is that our logging code is being called and the objects aren't setup. The logging code is executed via a method attribute we have setup using PostSharp (which get called before and...

asp.net MVC - conditional compilation directly in aspx (site.master)?

Hi there, I seem to be having an issue with the conditional compilation tags directly en my site.master.. basically i have the following but it reports "Cannot resolve symbol DEBUG" in the compiler alhough i can run in DEBUG and RELEASE ... but the final output always prints whats in DEBUG weather i am in RELEASE or DEBUG... And as me...

Conditional Java compilation

Hi all, I'm a longtime C++ programmer, new to Java. I'm developing a Java Blackberry project in Eclipse. Question - is there a way to introduce different configuration sets within the project and then compile slightly different code based on those? In Visual Studio, we have project configurations and #ifdef; I know there's no #ifdef in...

Conditional compilation symbols not being defined

Hello, I am having trouble getting Visual Studio to behave as I would expect it. I created 2 configuration profiles. One has the symbol FOO defined and the other has the symbol BAR defined. And I have this code: static class MyClass{ #if FOO public static string const MyData="foo defined"; #endif #if BAR /*yes, I know #elif would work...

Tool for compiling automatically all ifdef / ifndef directives

My C project uses preprocessor directives to activate / deactive some features. It's not unusual to find some of the less common configurations do not compile anymore due to a change made a few days ago within an #ifdef. We use a script to compile the most common configurations, but I'm looking for a tool to ensure everything is compile...

Conditional Attribute

A quick C# question, I would like to know that in my project > Properties > Build, there is a check "Define DEBUG constant", so if I check that and then do this, [Conditional(DEBUG)] public static void Foo() { Console.WriteLine("Executed Foo"); } See it's not "DEBUG" its the DEBUG constant. So will this be okay? Or do I have to ...

Conditional Compiling - Phasing out Part of code in C#

I'm working on a project, where I need a set of classes to be designed and used for one phase of the project. In the subsequent phase, we will not be needing the set of classes and methods. These set of classes and methods will be used throughout the application and so if I add them as any other classes, I would need to manually remove ...

How to setup different Resources for different compile macros in Visual Studio?

I have a String resource that needs to have different value based on the conditional compile. How to setup different Resources for different compile macros in Visual Studio 2008 Professional? ...

Conditional compilation with WISE

I need to adapt existing WISE installers for 64-bit, but don't want to make copies of the existing installers. For future maintenance purposes, I want one project that produces both 32-bit and 64-bit installers. Googling this, I find indications that it's possible, but no straightforward documentation explaining what the correct approa...

Is it possible to modify source code with ant?

I would like to do conditional compilation in a program of mine. I know that if you declare a public static final boolean the compiler will ignore the branch that is not traversed. Is it possible to have an ant target change a variable before building the program? For example if I have: final public static boolean windows = false; ...

conditional compilation statement in limits.h

I am not able to understand the following statement from the file limits.h. What is the use of this statement and what does it accomplishes? /* If we are not using GNU CC we have to define all the symbols ourself. Otherwise use gcc's definitions (see below). */ #if !defined __GNUC__ || __GNUC__ < 2 ...

using #if DEBUG conditional compilation statement in aspx page

I am trying to do something like this in an aspx page: <head runat="server"> <% #if DEBUG %> <script src="jquery-1.3.2.js" type="text/javascript"></script> <% #else %> <script src="jquery-1.3.2.min.js" type="text/javascript"></script> <% #endif %> </head> I get an error "Preprocessor directives must appear...

How to find out exact version of iPhone SDK for conditional compilation?

I'm looking for a macro that specified the exact version of the iPhone SDK used for compilation. This is needed because when compiling with (and only with) SDK 3.0, I need to add some additional code. __IPHONE_OS_VERSION_MIN_REQUIRED is not the right choice here, since it can be set by the user with parameter -mmacosx-version-min. For e...