Skip to content

Commit 5ef9e45

Browse files
author
Mike Pall
committed
Fix OSX build.
Reported by jnozsc.
1 parent 67654be commit 5ef9e45

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/lj_prng.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,13 @@ int LJ_FASTCALL lj_prng_seed_secure(PRNGState *rs)
183183

184184
#elif LJ_TARGET_OSX || LJ_TARGET_BSD || LJ_TARGET_SOLARIS || LJ_TARGET_CYGWIN
185185

186-
if ((!__ELF__ || getentropy) && getentropy(rs->u, sizeof(rs->u)) == 0)
186+
#ifdef __ELF__
187+
if (getentropy && getentropy(rs->u, sizeof(rs->u)) == 0)
188+
goto ok;
189+
#else
190+
if (getentropy(rs->u, sizeof(rs->u)) == 0)
187191
goto ok;
192+
#endif
188193

189194
#endif
190195

0 commit comments

Comments
 (0)