Portable macros in base/macros.h

Fix #216.
Let's put the `__declspec` back, it will please VS and provide better compatibility with older versions.