preprocessor platform detection and extern decl

I tried to put in some platform-detection in the form of queries to predefined preprocessor macros. I did so for those who (like me) are too lazy to write the $(CONFIG) preprocessor declarations into the Makefile.

There was also the int wcwidth( wchar_t ) function (from wchar.h) that benefited from an extern declaration; it no longer triggers a compiler warning. I don't know why it triggered the compiler warning in the first place, nor do I know why this silences that warning.