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.
This commit is contained in:
Rich Felker 2011-06-06 20:12:42 -04:00
commit cbf35978a9
2 changed files with 6 additions and 0 deletions

View file

@ -7,6 +7,9 @@ extern "C" {
#include <bits/errno.h>
#ifdef __GNUC__
__attribute__((const))
#endif
extern int *__errno_location(void);
#define errno (*__errno_location())