Top "C-preprocessor" questions

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

Differences in Macro ## concatenation operator between Visual-C++ and gcc

I'm having a macro like this ( not exactly, but function is quite equivalent): #define STRUCTMEMBER(Member,Value) GlobalStructInstance. ## Member = Value ... …

visual-c++ gcc c-preprocessor stringification
#elseif vs #elif (C/C++ preprocessor)

I have found that writing #ifdef ... #elseif defined(...) #else #endif always results in using either the #ifdef or the #else …

c++ c-preprocessor conditional-compilation
Making something both a C identifier and a string?

Say you want to generate a matched list of identifiers and strings enum { NAME_ONE, NAME_TWO, NAME_THREE }; myFunction(…

c c-preprocessor preprocessor-directive
What does #line mean?

What does the following line do? #line 25 "CSSGrammar.y" And what's with the extension?

c++ c-preprocessor preprocessor-directive
GCC, stringification, and inline GLSL?

I'd like to declare GLSL shader strings inline using macro stringification: #define STRINGIFY(A) #A const GLchar* vert = STRINGIFY( #version 120\…

c++ opengl gcc glsl c-preprocessor
Array of macros in c -- is it possible

I was wondering if it is possible to create something like an array of macros. I've implemented the following code …

c c-preprocessor atmel
What is the reason for #pragma once inside header guards?

Just seen this inside <boost/asio.hpp> #ifndef BOOST_ASIO_HPP #define BOOST_ASIO_HPP #if defined(_MSC_…

c++ boost c-preprocessor header-files pragma
Portably detect __VA_OPT__ support?

In C++20, the preprocessor supports __VA_OPT__ as a way to optionally expand tokens in a variadic macro if the …

c++ c-preprocessor c++20
Adding default arguments to variadic macro

Is it possible to add default arguments before variable argument in variadic macro? e.g I have the version of …

c++ c-preprocessor variadic-functions variadic-macros
#ifdef with multiple tokens, is this legal?

Today I came across some C++ code that contains an #ifdef clause like this: #ifdef DISABLE_UNTIL OTHER_CODE_IS_…

c++ c-preprocessor language-lawyer conditional-compilation