I have a porting job from one OS to another. A lot of the work is removing OS-specific header files from the code, and defining the old symbols in a new header, or refactoring the code a bit. I've been commenting out the #include "rtos.h" lines and seeing what symbols become undefined and porting those, but there are many such files and it's tedious and error prone.
Is there a tool or better way to do this? It would help of each line in the C file would be annotated with the origin of the symbol.
if (errno == EIO) "EIO" in errno.h
{ ...
}