Explorar o código

create _wenviron if not already done (close https://github.com/HaxeFoundation/hashlink/issues/175)

Nicolas Cannasse %!s(int64=7) %!d(string=hai) anos
pai
achega
edc62091dd
Modificáronse 1 ficheiros con 6 adicións e 0 borrados
  1. 6 0
      src/std/sys.c

+ 6 - 0
src/std/sys.c

@@ -200,6 +200,12 @@ HL_PRIM varray *hl_sys_env() {
 	pchar **e = environ;
 	pchar **e = environ;
 	pchar **arr;
 	pchar **arr;
 	int count = 0;
 	int count = 0;
+#	ifdef HL_WIN_DESKTOP
+	if( e == NULL ) {
+		_wgetenv(L"");
+		e = environ;
+	}
+#	endif
 	while( *e ) {
 	while( *e ) {
 		pchar *x = pstrchr(*e,'=');
 		pchar *x = pstrchr(*e,'=');
 		if( x == NULL ) {
 		if( x == NULL ) {