From: Rich Felker Date: Tue, 7 Jun 2011 00:12:42 +0000 (-0400) Subject: use __attribute__((const)) for errno and pthread_self if __GNUC__ is defined X-Git-Tag: v0.7.11~71 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=cbf35978a9870fb1f5c73a852c986d4fcca6c2d4;p=oweals%2Fmusl.git use __attribute__((const)) for errno and pthread_self if __GNUC__ is defined this is not too ugly and should result in significant code size and performance improvements for many programs. --- diff --git a/include/errno.h b/include/errno.h index d9c2c9c7..9d680338 100644 --- a/include/errno.h +++ b/include/errno.h @@ -7,6 +7,9 @@ extern "C" { #include +#ifdef __GNUC__ +__attribute__((const)) +#endif extern int *__errno_location(void); #define errno (*__errno_location()) diff --git a/include/pthread.h b/include/pthread.h index 5d97ebf6..a0af20fe 100644 --- a/include/pthread.h +++ b/include/pthread.h @@ -76,6 +76,9 @@ int pthread_detach(pthread_t); void pthread_exit(void *); int pthread_join(pthread_t, void **); +#ifdef __GNUC__ +__attribute__((const)) +#endif pthread_t pthread_self(void); int pthread_equal(pthread_t, pthread_t);