Merge "Protect against misuse of an implementation detail." into main am: 4f9800aaeb am: 130b820e43
Original change: https://android-review.googlesource.com/c/platform/bionic/+/3361267
Change-Id: I29322aa4294b3313dbaa242f2f896219d09fa426
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/libc/include/pthread.h b/libc/include/pthread.h
index 71ea8f9..cdf1b8c 100644
--- a/libc/include/pthread.h
+++ b/libc/include/pthread.h
@@ -314,7 +314,7 @@
pthread_t pthread_self(void) __attribute_const__;
-#if __USE_GNU && __BIONIC_AVAILABILITY_GUARD(26)
+#if defined(__USE_GNU) && __BIONIC_AVAILABILITY_GUARD(26)
/**
* [pthread_getname_np(3)](https://man7.org/linux/man-pages/man3/pthread_getname_np.3.html)
* gets the name of the given thread.
@@ -350,7 +350,7 @@
* Available since API level 36.
* See sched_getaffinity() and pthread_gettid_np() for greater portability.
*/
-#if __USE_GNU && __BIONIC_AVAILABILITY_GUARD(36)
+#if defined(__USE_GNU) && __BIONIC_AVAILABILITY_GUARD(36)
int pthread_getaffinity_np(pthread_t __pthread, size_t __cpu_set_size, cpu_set_t* __cpu_set) __INTRODUCED_IN(36);
#endif
@@ -363,7 +363,7 @@
* Available since API level 36.
* See sched_getaffinity() and pthread_gettid_np() for greater portability.
*/
-#if __USE_GNU && __BIONIC_AVAILABILITY_GUARD(36)
+#if defined(__USE_GNU) && __BIONIC_AVAILABILITY_GUARD(36)
int pthread_setaffinity_np(pthread_t __pthread, size_t __cpu_set_size, const cpu_set_t* __cpu_set) __INTRODUCED_IN(36);
#endif