Skip to content

Commit 1006ff8

Browse files
committed
Use POSIX getenv on Cygwin
The Windows-native GetEnvironmentVariable cannot be relied on, as Cygwin does not always copy environment variables set through Cygwin to the Windows environment block, particularly after fork().
1 parent 4fc17d0 commit 1006ff8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

common.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ please https://github.com/xianyi/OpenBLAS/issues/246
439439
typedef char env_var_t[MAX_PATH];
440440
#define readenv(p, n) 0
441441
#else
442-
#ifdef OS_WINDOWS
442+
#if defined(OS_WINDOWS) && !defined(OS_CYGWIN_NT)
443443
typedef char env_var_t[MAX_PATH];
444444
#define readenv(p, n) GetEnvironmentVariable((LPCTSTR)(n), (LPTSTR)(p), sizeof(p))
445445
#else

0 commit comments

Comments
 (0)