C/C++ Embedded Files (2013)
4rknova.com
C/C++ Embedded Files (2013)
1–10 of 57 posts
Re: C/C++ Embedded Files (2013)
#2Re: C/C++ Embedded Files (2013)
#3Regardless 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)
#4Re: C/C++ Embedded Files (2013)
#5Re: C/C++ Embedded Files (2013)
#6All a bit less relevant now since recent C++ versions have this built in by default. Generally something languages have been IMO too slow on (e.g. Go picked this up four or so years ago, after a bunch of less nice home-grown alternatives), it's actually just really useful to make things work in the real world, especially for languages that you can distribute as single-file binaries (which IMO should be all of them, but sadly it's not always).
Re: C/C++ Embedded Files (2013)
#7Outdated, modern solution is baked in now https://en.cppreference.com/w/c/preprocessor/embed
> 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 only way I know what "search" means in this context is by looking at an example, and the example says "it's basically a filename".
So now I think to myself: if I want to remain portable, I'll just write a python script to do a damn substitution to embed my file, which is guaranteed to work under _any_ implementation and I don't have to worry about it as soon as I have my source file.
Does anyone else feel this way or is it just me?
Re: C/C++ Embedded Files (2013)
#8Outdated, 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)
#9Earlier quoted context omitted.
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…
...what? What are you talking about? In what world would a compiler implement a preprocessor directive to ever use an llm, the internet, or your credit card details (from where would it get those)??? There are always implementation defined things in every language, for example, ub behavior. Do you get worried that someone will steal your bitcoin every time you use after free? Of course not! Even in Python when you OO…
Re: C/C++ Embedded Files (2013)
#10Outdated, 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…