mapi: Rewrite mapi_abi.py to get rid of preprocessor magic.