This is a drop-in hack for enabling long-range offmesh connections in an application using the unmodified Recast Navigation library. This avoids the need to maintain a fork of the library if your game features portals, trains, non-euclidean geometry or some such.
It works by injecting a private method into dtNavMesh, and relies on implementation details of the Detour library which may change in the future. However, the implementation details in question have been stable for three years so this is unlikely to happen any time soon.
The code is based on PR #645 by niji-k.
This manual linking mechanism is brittle. If you are loading and unloading navmesh tiles at runtime you must take care to 'unconnect' any long-range links you create, or you may encounter null-pointer crashes when querying the navmesh.