This looks great. The diff is quite inefficient for patching with the C preprocessor branches.
Since it patches the code, looking at its tree structure, is the diff human readable, and can it be edited directly? This is a major contributor to why I opt for sed for patching.