4 ms·
Even xxd has a mode to dump a file in the way expected by C. From then it's just another #include away.
by kccqzy 8y ago
Even xxd has a mode to dump a file in the way expected by C. From then it's just another #include away.
- makapuf 8y agoI personnally end up using my own simple python scripts. Alternatives being : - use objcopy but this needs to specify the binary of the output, which some build settings can make complex at the compile stage - use ld and -o binary. this works but this will put all data in .data section which puts it in ram, without being able to change it. - use incbin on inline assembly. this will work too but it's slightly more complex and relies on inline assembly so a bit less portable. - use xxd utility : this only works on linux, does not export const unsigned char[] (fixable with a simple sed) and we lack the ability to export just a header or control prefix / extensions.