$ cat file1.c
foo bar
#ifdef foo
bar
#endif
qux
#ifdef foo2
bar2
#endif
qzzx
.
$ cat file2.c
foo bar
#ifdef foo_
bar_
#endif
qux
#ifdef foo3
bar3
#endif
quux
.
$ diff \
> <(awk '/^[[:space:]]*#if/,/^[[:space:]]*#endif/{next}1' file1.c) \
> <(awk '/^[[:space:]]*#if/,/^[[:space:]]*#endif/{next}1' file2.c)
3c3
< qzzx
---
> quux