4 ms·
It is a preprocessor directive, the result must be as if the contents of the file were inserted byte by byte as integer literals. See [1] for more information
by unwind 4y ago
It is a preprocessor directive, the result must be as if the contents of the file were inserted byte by byte as integer literals.
See [1] for more information (which, btw, also states that #embed is in C23, not C21 (which doesn't exist as far as I know)).
[1]: https://thephd.dev/finally-embed-in-c23 https://thephd.dev/finally-embed-in-c23
- JonChesterfield 4y agoIf it's implemented in the preprocessor - e.g. expanding to a comma delimited char array - then the performance justification for adding it to the compiler is lost. However you might be using "preprocessor directive" in the language semantic phase sense, not in the "preprocessor does it" sense.
- Gibbon1 4y agoIt's inserted as a binary blob by the compiler. So just a simple copy of the file contents.