preprocessor 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

5

Solved

I use to define macros (not just constants) in C like #define loop(i,a,b) for(i=a; i<b; ++i) #define long_f(a,b,c) (a*0.123 + a*b*5.6 - 0.235*c + 7.23*c - 5*a*a + 1.5) Is there a way of doing...
Slowpoke asked 8/4, 2016 at 4:47

11

I am writing my first Razor page today, and can't figure out how to enter #if debug ... #else ... #endif How can I do that in Razor?
Mima asked 14/1, 2011 at 21:32

19

In C/C++/Objective C you can define a macro using compiler preprocessors. Moreover, you can include/exclude some parts of code using compiler preprocessors. #ifdef DEBUG // Debug-only code #endif ...
Gynandrous asked 2/6, 2014 at 21:6

5

Solved

I have run into a bug with gcc v3.4.4 and which to put an #ifdef in my code to work around the bug for only that version of the compiler. What are the GCC compiler preprocessor predefined macros t...
Triplex asked 20/12, 2009 at 19:32

37

Solved

How to make printf to show the values of variables which are of an enum type? For instance: typedef enum {Linux, Apple, Windows} OS_type; OS_type myOS = Linux; and what I need is somethin...
Rosalinarosalind asked 23/2, 2011 at 16:7

9

Solved

Is there a way to do the following preprocessor directives in Python? #if DEBUG < do some code > #else < do some other code > #endif
Swafford asked 27/1, 2009 at 1:10

7

I am converting from Eclipse CDT. The preprocessor macro feature is a must when navigating through C/C++ code with preprocessor defines (whether explicitly specified in Makefile or included through...
Harriott asked 9/3, 2018 at 17:10

3

Solved

Like we have preprocessor directives in C++ for conditional includes. Similarly, how to do conditional importing in QML? if x import ABC 1.0 else import PQR 2.0
Kasey asked 12/12, 2014 at 9:22

12

Solved

I am making an app that processes sensitive credit card data. If my code is running in debug mode I want to log this data to the console and make some file dumps. However on the final appstore v...
Misdemeanor asked 30/1, 2012 at 11:26

18

Solved

Alternate titles to aid search Xcode can't find header Missing .h in Xcode Xcode .h file not found lexical or preprocessor issue file not found I'm working on an iOS application project which c...
Kaykaya asked 4/4, 2011 at 20:18

31

Solved

The standard predefined macro __FILE__ available in C shows the full path to the file. Is there any way to shorten the path and get just the filename? I mean instead of /full/path/to/file.c I see ...
Garrygarson asked 13/12, 2011 at 10:57

5

Solved

Is there a way to add extra preprocessor #define in devenv command line?
Frankfort asked 23/11, 2009 at 13:34

3

Solved

Motivating background info: I maintain a C++ library, and I spent way too much time this weekend tracking down a mysterious memory-corruption problem in an application that links to this library. T...
Poacher asked 4/4, 2022 at 12:16

2

I have created and applied a simple .xcconfig file containing GCC_PREPROCESSOR_DEFINITIONS[config=Debug] = FOODEBUG GCC_PREPROCESSOR_DEFINITIONS[config=Release] = FOORELEASE and main.cpp contain...
Unsought asked 12/2, 2014 at 12:17

4

Solved

I'm consuming an API that returns something like: {'name': 'foo', 'start': {'date': '2016-06-19', 'time': '18:00'}} And I want to desearialize it with marshmallow to get only the name and the st...
Sunstroke asked 19/6, 2016 at 12:26

4

Solved

Environment: Visual Studio 10, CLR/CLI Class Library project, built with Platform Toolset v100, targeting framework version v3.5. I am aware that this question was already asked here, but I did no...
Chloe asked 2/9, 2013 at 10:57

4

What is the difference between preprocessors and transpilers (or transcompilers)? I already found the difference between compiler and transpiler, when searching for the answer. For example CSS prep...
Holmberg asked 17/4, 2017 at 21:3

0

Having 2 strange warnings during auto generation enum + string items... EnumItems.h (2 times included header to build enum and string array + possibility to have multiple enums and single boilerpla...
Grayce asked 22/12, 2021 at 21:49

2

Solved

I would like to know what ## does in this macro definition: #define debug(M, ...) fprintf(stderr,M "\n",##__VA_ARGS __) I googled for an answer and I came up with the following. The ## will rem...
Helli asked 19/10, 2018 at 11:32

8

Solved

I am looking for a solution to only define a function once in Javascript using something exactly like #ifndef in compiled languages. I found a couple of libraries that were supposed to mimic this f...
Tameika asked 11/9, 2011 at 3:27

3

Solved

A simple question that Google doesn't help me with. Is it legal in C++ to use #elif clause in the context of #ifdef? It seems to compile and work as expected with all the major compilers in the c++...
Caricature asked 31/10, 2017 at 22:48

3

I am working in react with typescript and tailwindcss. What I want is that instead of using @apply directive in main tailwind.css file (the file which conatins @tailwind base, @tailwind components,...
Wilcox asked 1/1, 2021 at 19:28

2

Solved

I can't find how to declare function like macros in CMake. I need a macro function like: #define MYFUNC(foo) QString( foo + "_suffix" ) to be defined by my CMakeLists.txt file. I tried: add_de...
Christiniachristis asked 3/4, 2020 at 9:43

2

My Tensorflow model makes heavy use of data preprocessing that should be done on the CPU to leave the GPU open for training. top - 09:57:54 up 16:23, 1 user, load average: 3,67, 1,57, 0,67 Tasks: 4...
Covenantee asked 10/8, 2020 at 8:2

© 2022 - 2025 — McMap. All rights reserved.