4
0
mirror of git://sourceware.org/git/newlib-cygwin.git synced 2025-01-25 16:47:20 +08:00
Corinna Vinschen 6252fd0265 Cygwin: machine/_arc4random.h: Fix copy/paste bug
Remove a stray  __END_DECLS.  It didn't hurt in the only
(plain C) file including this header, but still...

Fixes: 030a762535c1 ("Cygwin: fix arc4random after fork(2)")
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2024-01-29 16:42:50 +01:00

39 lines
829 B
C

/* machine/_arc4random.h
This file is part of Cygwin.
This software is a copyrighted work licensed under the terms of the
Cygwin license. Please consult the file "CYGWIN_LICENSE" for
details. */
#ifndef _MACHINE_ARC4RANDOM_H
#define _MACHINE_ARC4RANDOM_H
extern int __isthreaded;
#define _ARC4_LOCK_INIT __LOCK_INIT(static, _arc4random_mutex);
#define _ARC4_LOCK() \
do { \
if (__isthreaded) \
__lock_acquire (_arc4random_mutex); \
} while (0)
#define _ARC4_UNLOCK() \
do { \
if (__isthreaded) \
__lock_release (_arc4random_mutex); \
} while (0)
static inline void
_arc4random_forkdetect(void)
{
extern int __in_forkee;
if (__in_forkee)
rs = NULL;
}
#define _ARC4RANDOM_FORKDETECT() _arc4random_forkdetect ()
#endif /* _MACHINE_ARC4RANDOM_H */