libc/libpthread: Add guard to fix redundant __isthreaded declarations.
authorSascha Wildner <saw@online.de>
Sun, 7 Apr 2019 16:34:48 +0000 (18:34 +0200)
committerSascha Wildner <saw@online.de>
Sun, 7 Apr 2019 18:43:25 +0000 (20:43 +0200)
include/stdio.h
lib/libc/include/libc_private.h
lib/libthread_xu/thread/thr_private.h

index 92ccbe9..c03eb01 100644 (file)
@@ -414,7 +414,10 @@ __sfileno(FILE *_fp)
        return (_p->_fileno);
 }
 
+#ifndef __LIBC_ISTHREADED_DECLARED
+#define __LIBC_ISTHREADED_DECLARED
 extern int __isthreaded;
+#endif
 
 #ifndef __cplusplus
 #define        feof(p)         (!__isthreaded ? __sfeof(p) : (feof)(p))
index 70152b4..3ef5222 100644 (file)
  * or more threads. It is used to avoid calling locking functions
  * when they are not required.
  */
+#ifndef __LIBC_ISTHREADED_DECLARED
+#define __LIBC_ISTHREADED_DECLARED
 extern int     __isthreaded;
+#endif
 
 /*
  * File lock contention is difficult to diagnose without knowing
index bbf0b50..97b2733 100644 (file)
@@ -597,7 +597,8 @@ do {                                                                \
        (curthr->report_events &&                       \
         (((curthr)->event_mask | _thread_event_mask ) & e) != 0)
 
-#if !defined(_LIBC_PRIVATE_H_) && !defined(_STDIO_H_)
+#ifndef __LIBC_ISTHREADED_DECLARED
+#define __LIBC_ISTHREADED_DECLARED
 extern int __isthreaded;
 #endif