REDIVIVUS

Proposals / #1368

Recover pointer results in the Mac word-wrap allocator and list builder

checked · by eejitgames · submitted 2026-11-06

Mac AllocWordWrapNode and WordWrapString still declare undefined results, while native code returns and consumes full heap-node pointers. The allocator returns its 8-byte node; the wrapper returns that node directly or the linked-list head. Allocation, linking, drawing and freeing agree on text pointer+0 and next pointer+4. Windows's allocator already returns D2TextLineStrc*. That struct is absent in Mac and propose cannot create structs, so use void* as the opaque node-pointer result. Preserve all existing inputs and calling conventions.

Changes 2, applied together

  1. Set prototype mac 0x00048d48

    signatureundefined D2WINFONT_AllocWordWrapNode(ushort * pszText, size_t nSize, int32_t bTrimLeadingSpace)→void * D2WINFONT_AllocWordWrapNode(ushort * pszText, size_t nSize, int32_t bTrimLeadingSpace)
    convention__fastcc
  2. Set prototype mac 0x00048adb

    signatureundefined D2WINFONT_WordWrapString(ushort * wszString, int * pLineCount, int nMaxWidth)→void * D2WINFONT_WordWrapString(ushort * wszString, int * pLineCount, int nMaxWidth)
    convention__cdecl