It is indeed Wine-specific, but on Windows it isn't as much of a problem because AllocConsole gives you the same cmd you would use normally, while wineconsole is inferior to a normal terminal.
I think that what you're looking for is `AttachConsole`. Depending details of process hierarchy, something `if (!AttachConsole(ATTACH_PARENT_PROCESS)) AllocConsole()` instead of plain `AllocConsole` should do what you want both on Windows and Wine.