Portable macros in base/macros.h

Fix #216.