Top "C-preprocessor" questions

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

Escaping a # symbol in a #define macro?

Without going into the gory details I want to use a #define macro that will expand to a #include but …

c++ c macros c-preprocessor preprocessor-directive
# and ## in macros

#include <stdio.h> #define f(a,b) a##b #define g(a) #a #define h(a) g(a) …

c c-preprocessor stringification
How to detect LLVM and its version through #define directives?

The question is quite clear I think. I'm trying to write a compiler detection header to be able to include …

c clang llvm c-preprocessor
Is it possible for C preprocessor macros to contain preprocessor directives?

I would like to do the equivalent of the following: #define print_max(TYPE) \ # ifdef TYPE##_MAX \ printf("%lld\n", …

c macros nested c-preprocessor expansion
#ifdef inside #define

I am trying to write something like this: #define COV_ON(x) \ #ifdef COVERAGE_TOOL \ _Pragma (COVERAGE #x) #endif Is …

c c-preprocessor
How to manually deprecate members

Unlike Objective-C, Swift has no preprocessor, so is there still a way to manually deprecate members of a class? I …

ios objective-c swift c-preprocessor deprecated
Documenting preprocessor defines in Doxygen

Is it possible to document preprocessor defines in Doxygen? I expected to be able to do it just like a …

c++ c-preprocessor doxygen
error: pasting "." and "red" does not give a valid preprocessing token

I'm implementing The X macro, but I have a problem with a simple macro expansion. This macro (see below) is …

c macros c-preprocessor
How to generate a newline in a cpp macro?

How do I write a cpp macro which expands to include newlines?

c++ macros c-preprocessor
What predefined macro can I use to detect clang?

I'm trying to detect the compiler used to compile my source code. I can easily find predefined macros to check …

c macros clang c-preprocessor