conditional-compilation Questions

3

Solved

Is it possible to use CPP extension on Haskell code which contains multiline string literals? Are there other conditional compilation techniques for Haskell? For example, let's take this code: --...
Monochrome asked 30/3, 2010 at 22:26

1

I am building an iOS framework and i need the same framework to be used in public apps and in some internal apps , the difference is that in the internal apps I need access to some classes and func...
Namtar asked 10/11, 2016 at 7:33

3

Solved

I've got a legacy C++ code base which includes the following: // this kludge is required because SparcWorks 3.0.1 under SunOS // includes malloc.h in stdlib.h, and misdeclares free() to take a char...
Dyak asked 23/4 at 11:40

18

Solved

I need my code to do different things based on the operating system on which it gets compiled. I'm looking for something like this: #ifdef OSisWindows // do Windows-specific stuff #else // do Unix...
Matchbook asked 26/9, 2008 at 23:44

2

Solved

To the best of my understanding of the Rust documentation, attributes are applied only to the line directly following an attribute. So, if I want to conditionally compile a line I can do this: #[c...
Backpedal asked 29/10, 2019 at 6:29

5

Solved

I am working on a project that includes a Mac application and an iPad application that share code. How can I use conditional compile switches to exclude Mac-specific code from the iPhone project an...
Nava asked 5/7, 2010 at 17:53

1

Solved

When trying to write or interpret cfg statements like e.g. #[cfg(all(unix, not(target_arch = "wasm32")))] from the atty crate, I am sometimes unsure what exactly unix means here. (Appare...
Airlike asked 15/6, 2023 at 8:55

5

Solved

I know that I can use preprocessor directives in C# to enable/disable compilation of some part of code. If I define a directive in the same file, it works fine: #define LINQ_ENABLED using System;...
Zellner asked 12/12, 2012 at 9:22

3

The Rust language supports conditional compilation using attributes like #[cfg(test)]. Rust also supports build scripts using a build.rs file to run code as part of the build process to prepare for...
Cati asked 18/3, 2019 at 20:18

6

Solved

Is There anyway to #define Constant on a Visual Studio Solution Basis? One can define a constant on a csproject basis, and one can put #define constant in cs file, but I wonder whether one can def...
Neoptolemus asked 11/3, 2011 at 2:2

3

Solved

I would like to edit a single rmarkdown (Rmd) document with a list of "problems", each followed by its solution. Each solution may contain the results of the R console, but also some expl...
Costanzia asked 5/10, 2015 at 9:0

3

Solved

I have various implementations of a partial class DeviceServices to provide platform specific implementations of certain device or OS specific features for Android, iOS and so on. My app is targeti...
Octangular asked 22/10, 2022 at 17:4

2

Cargo features allow conditional compilation, so the final build will have just specific groups of features which can be filtered by the final user. Now depending on the complexity of a library cra...
Miterwort asked 9/8, 2022 at 12:44

1

Solved

Running cargo build will succeed for the following code: #[cfg(test)] mod tests { #[test] fn func() { let x = 1; sss } } but will fail for this code: #[cfg(test)] mod tests { #[test] fn fu...
Cooe asked 10/7, 2022 at 16:53

2

Solved

I am writing documentation for a module that has some options controlled by a Cargo feature flag. I'd like to always show this documentation so that consumers of the crate know that it's available,...
Lightening asked 13/5, 2018 at 2:17

4

Solved

On few systems double is same as long double. How can I detect if long double is of extended precision than double at compile time and use it to conditional compile. I see there are predefined mac...

5

Solved

How do I check the iOS deployment target in a Swift conditional compilation statement? I've tried the following: #if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_8_0 // some code here #else /...

1

Objective C has preprocessor, Swift has compilation conditions that allows to use different code for different environments, for example for debug or release build: #if DEBUG print("debug me...
Giotto asked 18/1, 2022 at 14:23

8

Solved

Does C# have a not Conditional (!Conditional, NotConditional, Conditional(!)) attribute? i know C# has a Conditional attribute: [Conditional("ShowDebugString")] public static void ShowDebugStri...
Cessation asked 22/11, 2011 at 16:31

1

Solved

Let's assume I have the following feature defined in Cargo.toml: [features] my_feature = [] And the following code lives in src/lib.rs: #[cfg(feature = "my_feature")] fn f() { /* ... */ ...
Herbarium asked 12/10, 2021 at 7:34

16

Solved

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 pe...
Dodgem asked 1/10, 2009 at 18:17

4

Solved

I'm currently busy on a project where I need to use an external accessory to read Mifare 1k tags. The accessory was provided with an SDK, written in (Objective ?)C++ and I followed the instruction...

3

Solved

I capture the intent of the Makefile in pseudo code, then indicate the issues I have. I'm looking for a Makefile which is more user friendly in a test environment. The correct usage of the Makefile...
Externalism asked 10/1, 2012 at 22:33

3

Solved

For user authorization, I only want to include a specific module for each user. So I configured Conditional Compilation like this <DefineConstants>TRACE;DEBUG;SAMPLECONSTANT1</DefineConst...
Intramolecular asked 15/5, 2013 at 4:21

2

Solved

I'm trying to disable automated crash logs reports when one or both of two defines are set: DEBUG for our debug builds and INTERNATIONAL for the international builds. When I try to do that in the #...
Ploce asked 30/8, 2013 at 14:44

© 2022 - 2024 — McMap. All rights reserved.