1,906 questions
Advice
0 votes
7 replies
133 views
C Preprocessor: foreach/macro expansion with loop context
So I've been using this code for generating such statements following This Reddit post: #define LOOP(seq) END(A seq) #define BODY(x) int x; #define A(x) BODY(x) B #define B(x) BODY(x) A #define A_END #...
0 votes
1 answer
78 views
Automate removal of div/span attributes for code clean-up and easier merging
<span class="SpellingError SCXO166867203 BCX8" style="margin:0px;padding:0px;background-repeat:repeat-x;background-position:left bottom;">bv</span><span class="...
0 votes
0 answers
546 views
Docling Hyperlink Extraction Issue : I am using docling to convert pdf to markdown file, but hyperkink not preserved in markdown file after conversion
I’m currently using the Docling library in Python to extract text from PDF files. While it works well for retrieving visible text, I’ve noticed an issue with hyperlinks. Specifically, the library only ...
2 votes
1 answer
74 views
Why in Erlang do i need to specify `-module` if it is equal to filename?
For example, if I create file jopa.erl with this code inside ... -module(jopa). ...everything compiles without errors However, if I put this code inside jopa.erl ... -module(lol). and try to compile....
12 votes
7 answers
2k views
Construct an std::array at compile time in C++17 using the preprocessor
I am developing a C++17 framework that has optional third-party dependencies and I'd like to construct an std::array that contains the names of the available dependencies. The CMake file sets ...
0 votes
0 answers
68 views
Preprocessing Data with Scale and then Binarize in Python
I am working on some proof of concepts for ML and want to try an unusual scaling method. I would like to group my data and then "scale" it and apply a binarize to that data. Basically I ...
3 votes
0 answers
59 views
Can the GNU Assembler perform all macro expansions in a file and then output compilable code without macros?
Is there a way to have the GNU assembly process a source file that contains macros, expand them, and then output the expanded equivalent code in a form that could be assembled by as? Basically, I'm ...
3 votes
1 answer
161 views
__FILE__ without full path
The C++ macro __FILE__ typically includes the full path (with many compilers). For my tracing, I want just the file name, not the full path. Is there a built-in macro for this in any version of C++ or ...
4 votes
2 answers
227 views
How to accurately count tokens in a C program? Do preprocessor directives like #include and #define count?
I'm studying how tokenization works in C programming, especially for examination purposes. I want to understand how many tokens are present in the following C code and how preprocessor directives are ...
0 votes
0 answers
77 views
Using WXUSINGDLL has no effect on the linkage
my wxWidgets application has multiple C++ projects (one executable and all the other static libraries). I am using Visual Studio 2022 with a solution having Debug and Release configurations only for ...
1 vote
1 answer
166 views
How to disable all SIMD related feature macros in clang?
By default, clang defines some SIMD related macros: ~ $ 0 clang++ -dM -E -x c /dev/null | grep -i sse #define __SSE2_MATH__ 1 #define __SSE2__ 1 #define __SSE_MATH__ 1 #define __SSE__ 1 These can be ...
2 votes
1 answer
115 views
How to nest #if and #elif definitions inside a #ifdef macro in Inno Setup
I'm trying to do the following: [Code] #define TextMacro "Hello2" procedure InitializeWizard(); var Mode: Integer; begin #ifdef TextMacro #if TextMacro == "Hello" ...
2 votes
2 answers
91 views
Multiple definition linking error on macro expansion with expansion guards
I have a header file that introduces a macro that declares a Stack structure and some asociated functions that work with that struct. Header file (Stack.h) content is shown below: #ifndef STACK_H #...
7 votes
1 answer
159 views
Document function-like macros without evaluating if/else with Doxygen
I am trying to document a header file which has different "overloads" when parsed by C or C++. #ifdef __cplusplus /// myfuncA void myfuncA(); /// MYMACRO_A #define ...
3 votes
2 answers
125 views
Can a C program execute successfully if main() is defined as a macro?
We know that main() is the entry point of a C program. But what happens if we define main as a macro, like this? #define main something_else Will the program compile and run correctly? How do ...