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:
parent
71a80c5767
commit
cbf35978a9
2 changed files with 6 additions and 0 deletions
|
|
@ -7,6 +7,9 @@ extern "C" {
|
||||||
|
|
||||||
#include <bits/errno.h>
|
#include <bits/errno.h>
|
||||||
|
|
||||||
|
#ifdef __GNUC__
|
||||||
|
__attribute__((const))
|
||||||
|
#endif
|
||||||
extern int *__errno_location(void);
|
extern int *__errno_location(void);
|
||||||
#define errno (*__errno_location())
|
#define errno (*__errno_location())
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -76,6 +76,9 @@ int pthread_detach(pthread_t);
|
||||||
void pthread_exit(void *);
|
void pthread_exit(void *);
|
||||||
int pthread_join(pthread_t, void **);
|
int pthread_join(pthread_t, void **);
|
||||||
|
|
||||||
|
#ifdef __GNUC__
|
||||||
|
__attribute__((const))
|
||||||
|
#endif
|
||||||
pthread_t pthread_self(void);
|
pthread_t pthread_self(void);
|
||||||
int pthread_equal(pthread_t, pthread_t);
|
int pthread_equal(pthread_t, pthread_t);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue