I forgot to add that two days ago I added a program to pasdoc that works like a Pascal preprocessor, see http://pasdoc.sipsolutions.net/OtherTools. It can resolve many things, like $define, $ifdef, $include and FPC macros. The idea was to allow you to use FPC macros when developing your units, and then port them to Delphi easily by automatic convertion through this program.

Oh, and it works !

Unfortunately, it doesn't evaluale expressions inside $if constructs, and Matrix unit uses $if a lot. So to port Matrix unit to Delphi one would have to convert them to simple $ifdef with appropriate symbols. And of course the operator stuff would have to be put only inside {$ifdef FPC} --- and I agree here with Daniel that the overloaded operators stuff is one important advantage of this unit in FPC.

Anyway, if someone is really pressed into converting Matrix unit into Delphi, then you have now at least a way to automatically resolve all FPC macros for Delphi.