Open jefftrull opened 3 years ago
Adding support for #embed
would definitely be a Good Thing(tm), however it most likely wouldn't give the benefit of using the same by a 'real' compiler. Wave would have to translate the content of the file into a comma-separated sequence of bytes, while 'real' compilers could load things into memory directly without representing the content as a character sequence just to convert it back into the binary representation that will be embedded in the object file..
Just landed in C23, writeup here https://thephd.dev/finally-embed-in-c23
A PR for this has been submitted to Clang now https://github.com/llvm/llvm-project/pull/68620
This mechanism for creating arrays from binary files at compile time looks likely to land in C++23