surely the preprocessor method doesn't work in the general case, since the data can contain commas or parentheses. Regardless all of the methods suggested are terrible. If you don't have access to #embed, just write a trivial python script.
C/C++ Embedded Files (2013)
11–20 of 57 posts
Re: C/C++ Embedded Files (2013)
#12Re: C/C++ Embedded Files (2013)
#13surely the preprocessor method doesn't work in the general case, since the data can contain commas or parentheses. Regardless all of the methods suggested are terrible. If you don't have access to #embed, just write a trivial python script.
How is `xxd -i' terrible?
Just write a Python script that does the whole thing.
Re: C/C++ Embedded Files (2013)
#14Earlier quoted context omitted.
How is `xxd -i' terrible?
It's still lacking content that goes before/after the output. Just write a Python script that does the whole thing.
Re: C/C++ Embedded Files (2013)
#15surely the preprocessor method doesn't work in the general case, since the data can contain commas or parentheses. Regardless all of the methods suggested are terrible. If you don't have access to #embed, just write a trivial python script.
Re: C/C++ Embedded Files (2013)
#16Outdated, modern solution is baked in now https://en.cppreference.com/w/c/preprocessor/embed
The thing that always irks me about c++ is this sort of thing: > Explanation 1) Searches for the resource identified by h-char-sequence in implementation-defined manner. Okay, so now I have to make assumptions that the implementation is reasonable, and won't go and "search" by asking an LLM or accidentally revealing my credit card details to a third party, right? And even if the implementation _is_ reasonable the onl…
Re: C/C++ Embedded Files (2013)
#17``` inline constexpr auto bootstrap = #include "bootstrap.lua" ;
// ... later
lua.script(bootstrap, "@bootstrap"); ```
The lua code ``` R"( -- your code here )"; ```
Re: C/C++ Embedded Files (2013)
#18You can also do it using ld - it's something like ld -r --format binary -o out.o , although you do want some build system assistance to generate header files allowing you to access the thing (somewhat similar to the assembly example here). It's a bit of a performance but I strongly prefer it to generating header files in the earlier options - those header files can end up being _very_ large (they generally multiply u…
https://github.com/jcalvinowens/ircam-viewer/commit/17b3533b...
Re: C/C++ Embedded Files (2013)
#19Outdated, modern solution is baked in now https://en.cppreference.com/w/c/preprocessor/embed
Re: C/C++ Embedded Files (2013)
#20Why don't you #embed?