Top "C-preprocessor" questions

A textual macro processor applied before compiling C and C++ language programs.

Appending to __VA_ARGS__

I know I can do this: #define MACRO(api, ...) \ bool ret = api(123, ##__VA_ARGS__); This is just an example, it's …

c gcc c-preprocessor variadic-macros
Opposite of C preprocessor "stringification"

When using C preprocessor one can stringify macro argument like this: #define TO_STRING(x) "a string with " #x and …

c macros c-preprocessor stringification
What is the value of an undefined constant used in #if?

My preprocessor appears to assume that undefined constants are 0 for the purpose of evaluating #if conditions. Can this be relied …

c++ c-preprocessor
CUDA compiler (nvcc) macro

Is there a #define compiler (nvcc) macro of CUDA which I can use? (Like _WIN32 for Windows and so on.) …

c++ cuda macros c-preprocessor nvcc
Detect ARM NEON availability in the preprocessor?

According to the ARM ARM, __ARM_NEON__ is defined when Neon SIMD instructions are available. I'm having trouble getting GCC …

gcc macros arm c-preprocessor neon
Only run C preprocessor in cmake?

I'm trying to use cmake to simplify distributing my OpenCL program. I have a kernel file which includes several headers …

cmake opencl c-preprocessor
Preprocessor macro for Apple Watch?

I was looking at Apple's Lister (for Apple Watch, iOS, and OS X) sample. The sample performs a test for …

ios preprocessor watchkit c-preprocessor watchos-2
#define PORTX.x in Avr Studio 5 (ATmega16)

I'm writing a new and special library whith new algorithms and abilities for KS0108 GLCD Driver. I'm using ATMega16. My …

c c-preprocessor atmega16 avr-studio5
#define as unsigned char

I would like to know how can I tell to compiler that a #define is an unsigned char. #define SET_…

c c-preprocessor unsigned-char
Is #define banned in industry standards?

I am a first year computer science student and my professor said #define is banned in the industry standards along …

c c-preprocessor preprocessor-directive