conditional-compilation Questions
4
Solved
How can I do something similar to the following C code in VB 6?
#ifdef _DEBUG_
// do things
#else
// do other things
#end if
Dolor asked 29/1, 2012 at 8:54
6
Solved
What C preprocessor conditional should I use for OS X specific code? I need to include a specific library if I am compiling for OS X or a different header if I am compiling for Linux.
I know there...
Ethel asked 7/10, 2009 at 1:18
2
Solved
I have a project with a reference that may or may not exist. I have code that uses that reference and I'd like to compile it only if the assembly exists. I'm thinking something along the lines of:
...
Gallia asked 3/12, 2015 at 16:52
2
Solved
I have a T4 template that is used with the TextTemplatingFilePreprocessor to generate a class that I can then use to generate the output of the template.
At the start of the T4 template I import s...
Jacquelynejacquelynn asked 21/9, 2011 at 1:14
3
Solved
During the refinement process of the C++11 standard, it seems that is_trivially_destructible was considered a better/more-consistent name than has_trivial_destructor.
This is a relatively recent d...
Puzzler asked 3/10, 2012 at 4:53
2
Solved
I have a single codebase that needs to be compatible with Xcode 7 beta and Xcode 6.4. This is because beta testing and App Store builds should be built with the stable version of the compiler and S...
Carlottacarlovingian asked 3/7, 2015 at 19:18
1
Solved
I find strange behaviour when trying to load an Excel workbook.
I have an Excel-AddIn, written in .NET with COM Interop.
It is mainly used to create my own Ribbon-Tab, load workbooks from a menu a...
Extraction asked 7/10, 2014 at 8:31
1
Solved
What are the platform conditional defines for Android, iOS, Win32, Win64 in C++Builder? I've found only examples for Delphi.
Canaigre asked 23/4, 2015 at 16:33
4
Solved
Can you tell Visual Studio to output a different name of an exe file depending on if a specific conditional compilation symbol is set?
Redundant asked 18/5, 2010 at 8:30
4
I am fairly new to C++. I am currently working on a group project and we want to make our classes compatible with both the lab computers (Windows) and my computer (Mac OS X).
Here is what we have...
Philology asked 23/7, 2011 at 19:49
2
Solved
I have programmed C for quite a while now. During this time I have learned that it is a common convention to put the "#"-character that comes before preprocessor-directives at column one.
Ex...
Lovage asked 9/1, 2015 at 23:42
2
Solved
My Qt project links to a library that is linux-only. When the project is run under linux, I wish to have a signal fired on an event using a type defined in that library. A complication that I have,...
Mobile asked 22/11, 2010 at 14:38
4
Solved
I have a piece of code which I want to include if either of two macros are defined
#ifdef MACRO1 || MACRO2
void foo()
{
}
#endif
How do I accomplish this in C?
Conveyor asked 4/12, 2012 at 21:3
1
Solved
I try to conditionally generate C code from a Cython pyx file. I found in the Cython documentation that I can use DEF to define a value and IF to conditionally generate code based on a defined valu...
Turbulence asked 3/12, 2014 at 13:44
3
Solved
I have developed one Android app in one project with Eclipse - it's structured (coming from iPhone) so one constant defines whether it's the demo or the full version.
Now I have the problem that e...
Puritan asked 18/10, 2012 at 20:41
7
Solved
I want to run some c++ code on Linux and Windows. There are some pieces of code that I want to include only for one operating system and not the other. Is there a standard #ifdef that once ca...
Lichee asked 11/7, 2011 at 12:15
3
I'm writing an assembly with some conditionally compiled members in it, e.g.:
[Conditional("DEBUG")]
public static void Log(string message) { /*...*/ }
And using it like so:
public void DoStuff...
Rainie asked 29/10, 2014 at 15:44
2
Solved
The documentation for if/ifdef is slightly confusing. For <?if [expression] ?>, it states:
Variables can be used to check for existence
...
If the variable doesn't exist, evaluation w...
Modillion asked 17/4, 2012 at 9:44
8
I have a library project in Java. I want to implement, test, and probably release several versions of the project, intented to be used with different Java versions: 6, 7, 8.
The simpliest way is j...
Luca asked 4/10, 2014 at 17:24
1
Solved
I have come across some example code that goes like this:
#ifdef WIN32
...
#elif WIN64
...
#endif
In an #ifdef block, is it actually legal to use #elif to mean #elif defined?
Cooperation asked 22/8, 2014 at 16:14
1
Solved
I know that I can do this in a *.h file:
#ifdef _DEBUG
#pragma comment(lib, "libtiffd.lib")
#else
#pragma comment(lib, "libtiff.lib")
#endif
But I want a way that I can do something such as this...
Progeny asked 7/8, 2014 at 13:41
1
Solved
In XE5 all conditional compilations such as
{$IFDEF MSWINDOWS}
are replaced with
{$IF defined(MSWINDOWS)}
For example System.Diagnostics.pas in XE4 had
...
implementation
{$IFDEF MSWINDOW...
Bagley asked 11/5, 2014 at 20:27
7
Solved
What is the alternative to having code with conditional compilation in C#?
I have a class that has lots of code that is based on # ifdef .. After sometime my code is unreadable.
Looking for refac...
Flowerer asked 24/9, 2010 at 12:1
1
Solved
I have an Android-specific fix in my Qt application, and I want that code to be compiled only when building for Android.
Is there an #if or #ifdef that will do that?
Whinchat asked 12/4, 2014 at 6:19
2
Solved
How to define preprocessor macros in build settings, like IPAD_BUILD, and IPHONE_BUILD (and how to use them in my factory methods)?
I'm using these by heart now, would be cool to know what is goin...
Cheloid asked 8/10, 2012 at 13:0
© 2022 - 2024 — McMap. All rights reserved.