System header <sys/mman.h> defines the macro SHARED as 0x10. Perhaps that header is getting included somehow. . If not that header then some other one.
You can find out for sure by adding the -H option to the CC command line. It will print the name of each included header as it is read, indenting to show where the header was included from. You can egrep for the pattern "define.*SHARED.*10" in list of files generated by the -H option
A workaround for your problem is to add
after including all headers in any file where you encounter this compile error. Of course, you would not be able to use the macro SHARED in its original context, but probably that is not an issue.