On Mon, 27 Apr 2020, Jacek Caban wrote:

On 27.04.2020 19:55, Jean-Baptiste Kempf wrote:

On Mon, Apr 27, 2020, at 19:40, Jacek Caban wrote:
On 27.04.2020 16:31, Steve Lhomme wrote:
It's needed by:
- getlogin() in mingwex

Could we prohibit getlogin() on non-desktop in headers instead?
Or call directly GetEnvironment directly?


If it works on all relevant Windows versions, that sounds good.

Well, GetEnvironment isn't an exact replacement - you could (fairly) easily have an environment where USERNAME is missing or overwritten by something else. So I wouldn't like an unconditional replacement of GetUserName with GetEnvironment("USERNAME").

I think the current one approach is fine - if GetUserName is missing and something happens to call it, GetEnvironment is a decent fallback.

I presume that this only comes up now as Steve has tried to weed out all potentially forbidden function calls from libmingw*.a - even if no libs actually ever called getlogin() to begin with (because otherwise it would have been an issue with VLC/WinStore even on 8.x). So alternatively we could just ignore this for now - but I think the current approach is fine as well.

// Martin



_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to