conditional-compilation Questions

3

Solved

In gcc I am writting friend class FriendMaker<T>::Type but Visual Studio wants friend FriendMaker<T>::Type. So I think it is time to go compiler specific. So What I need to ifdef for V...
Snuck asked 1/8, 2012 at 7:34

2

Solved

In Inno Setup, I have a main script which is the "core system", meaning everything which is absolutely needed for our software to install/run at all. Additionally, I'm writing script files for each...
Refund asked 3/2, 2014 at 21:34

0

I would like to be able to package my nuget files with a conditional compilation symbol (NUGET or similar) so that I can use a preprocessor directive specifically for my nuget build. eg #if NUGET ...
Equestrian asked 23/1, 2014 at 2:10

2

People recommend #ifdef for conditional compilation by a wide margin. A search for #ifdef substantiates that its use is pervasive. Yet #ifdef NAME (or equivalently #if defined(NAME) and related #i...
Pilpul asked 22/1, 2014 at 1:58

5

Solved

Each time I build my Visual C++ solution in Visual Studio 2010, the entire project (not the entire solution) recompiles. There must be a flag or configuration somewhere to make VS compile only the...
Gastrectomy asked 21/12, 2010 at 20:38

2

Solved

Trying to use the ifdef DEBUG constant in Visual Studio doesn't work for me in a .NET Framework 4.5, ASP.NET MVC 4. I made sure: The "Define DEBUG constant" is checked for the Debug configuratio...
Risarise asked 30/10, 2013 at 12:17

2

Solved

Today I came across some C++ code that contains an #ifdef clause like this: #ifdef DISABLE_UNTIL OTHER_CODE_IS_READY foo(); #endif Note the space between "DISABLE_UNTIL" and "OTHER_CODE_IS_READ...
Almaalmaata asked 11/10, 2013 at 15:32

2

Solved

We need to define a conditional compilation symbol in a class library project. This should not be checked in the source control (it doesn't apply to all developers), so it should be defined in some...
Palestine asked 3/8, 2009 at 9:10

1

Solved

What is the conditional to check if assertions are active in Delphi? I would like to be able to do something to suppress hints about unused variables when assertions are not active in code like p...
Dorelle asked 24/5, 2013 at 8:13

2

Solved

I have some C++ code, and want to perform an action if the __APPLE__ or __linux macros are defined. If I did it as a normal if conditional, it would be easy using ||: if (something || something) ...
Chivers asked 4/5, 2013 at 20:37

1

Solved

I am working on a large unit, the unit got so large that I decided to split it into 3 units. Let's say these unit names are Main, Common, and Objects. The Main unit uses both the other two units, a...
Farmhouse asked 15/3, 2013 at 21:30

2

In C#/VB in Visual Studio 2010, is there way in the code to determine whether the program is currently running in the IDE or not? eg. If ProgramRunningInIDE Then MessageBox.Show exc.Message ...
Heighttopaper asked 8/3, 2013 at 11:18

3

Solved

I used #ifdef Win32 for safe calls alike sprintf_s but now I want to build project with MinGW and it's just wrong now. I need to use #ifdef VC++ or somehow like that. Is it possible?
Loni asked 28/2, 2013 at 4:28

1

Solved

When I have in my code an #ifdef like this #ifdef _DEBUG printf("This is a debug build"); #endif Qt Creator grays out the printf even though it is a debug build, and when I run it "This is a de...
Producer asked 21/2, 2013 at 9:5

5

Solved

I just tried program Project1; {$APPTYPE CONSOLE} uses SysUtils; begin {$IFDEF CONSOLE} beep; {$ENDIF} end. and expected to hear a beep during runtime, but not. The following test works, ...

2

Solved

I'm trying to write code like here but using C++11 features, without Boost. Working from this example, I tried to define a response_trait, and basee conditional compilation on the result of the tr...
Pierpont asked 9/12, 2012 at 12:49

4

Solved

I understand using the NETFX_CORE directive, like this: #if NETFX_CORE // Windows 8 #else // Windows Phone 8 #endif More info: http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj...
Neoplasticism asked 27/11, 2012 at 22:38

1

Solved

Say I have a rather expensive assertion: bool IsCompatible(Object x, Object y) { // do expensive stuff here } If I test this assertion with: Debug.Assert(IsCompatible(x,y)); Will IsCompati...
Rum asked 14/11, 2012 at 17:7

3

Solved

Is there any kind of conditional compiling for Android? I had to make my project for Android 3 (API 11) just because ExifInterface has almost no useful attributes in Android 2.3 (API 10), despite t...
Hubey asked 14/11, 2012 at 13:56

2

Solved

I am looking for a predefined symbol to write a code like that: {$IFDEF LAZARUS} // code compiles by fpc/lazarus {$ELSE} // code compiles by delphi {$ENDIF}
Womenfolk asked 30/8, 2012 at 15:8

2

What is the purpose and good usage of #define directive in C#? There are already few questions on this topic but no answer I need. They only give examples how it works. But I need deeper explanati...
Swansdown asked 27/7, 2012 at 9:52

2

Solved

I am developing an Android app in Eclipse. I would like to target a wide variety of devices and SDK versions (for example, I can optionally support multi-touch). I understand the recommended approa...

4

Solved

In "Properties" of my project I have the following: I want to check if TEST symbol exists, and only then, do some things. So I did what you see in the picture below and in the class it works. Ho...
Daytime asked 30/11, 2011 at 11:8

3

Solved

Is it possible to define more than one conditional in one {$IFDEF} directive ? I would like to have syntax like this: {$IFDEF Condition1 OR Condition2} DoSomething; {$ENDIF} {$IFDEF Condition1 AND...
Undertone asked 4/1, 2012 at 9:47

6

Solved

Is it possible to use #define in an "if" statement? The following code works, but I get a warning that the macro is being redefined. if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { #d...
Novation asked 28/12, 2011 at 22:15

© 2022 - 2024 — McMap. All rights reserved.