c-preprocessor
What use cases necessitate #define without a token-string?
I have encountered the #define pre-processor directive before while learning C, and then also encountered it in some code I read. But apart from using it to definite substitutions for constants and to[详细]
2023-04-09 00:48 分类:问答Pre-processing C code with GCC
I have some C source files that need to be pre-processed so that I can use another application to add Code Coverage instrumentation code in my file.[详细]
2023-04-08 10:38 分类:问答Get function name as symbol (not as string) - C preprocessor
Is there a way in C to ge开发者_如何学JAVAt the function name on which I can use token-pasting (I know __FUNCTION__ and __func__, but they don\'t expand to name at pre-processing,[详细]
2023-04-08 02:34 分类:问答Including a header file from another directory
I have a main directory A with two sub directories B and C. Directory B contains a header file structures.c:[详细]
2023-04-08 00:52 分类:问答Macro with zero arguments - with or without parentheses
When defining macro with zero arguments we can define it with parentheses, thus looking more like function开发者_StackOverflow社区 or without parentheses.[详细]
2023-04-07 17:19 分类:问答Variable name from macro argument
I\'d like to do something like this: class SomeClass { }; GENERATE_FUNTION(SomeClass) The GENERATE_FUNCTION macro I\'d like to define a function whose name is to be determined by the macro argumen[详细]
2023-04-07 13:25 分类:问答Define a pre-processor variable for all the files in make
I have a number of .c and .h files with some parts of the code disabled by putting the code block in pre-processor directives e.g.[详细]
2023-04-07 07:37 分类:问答Macro that accept new object
In my code, I have: #define EV( event ) SendEvent( new event ); E开发者_C百科V( evFormat ); But I want to pass a created object in the EV macro, like:[详细]
2023-04-07 01:29 分类:问答Is C++ preprocessor metaprogramming Turing-complete?
I know C++ template metaprogramming is Turing-complete. Does the s开发者_如何转开发ame thing hold for preprocessor metaprogramming?Well macros don\'t directly expand recursively, but there are ways we[详细]
2023-04-06 19:00 分类:问答Ignoring invalid/non-relevant field attributes in C# class definitions
I\'ve defined a class file, and I am using it for two purposes (in an attempt to adhere to the DRY principle).There are Attributes on some of the fields, which are used at runtime by program A.Program[详细]
2023-04-06 06:28 分类:问答