提交 bf453d68 编写于 作者: R Rich Felker

restore attribute((const)) to pthread_self and errno location decls

revert commit a603a75a.

as a result of commit 1c84c999 this is
now safe, assuming an interpretation of the somewhat-underspecified
attribute((const)) consistent with real-world usage.
上级 1c84c999
...@@ -9,6 +9,9 @@ extern "C" { ...@@ -9,6 +9,9 @@ extern "C" {
#include <bits/errno.h> #include <bits/errno.h>
#ifdef __GNUC__
__attribute__((const))
#endif
int *__errno_location(void); int *__errno_location(void);
#define errno (*__errno_location()) #define errno (*__errno_location())
......
...@@ -115,6 +115,9 @@ struct protoent *getprotobynumber (int); ...@@ -115,6 +115,9 @@ struct protoent *getprotobynumber (int);
|| (defined(_XOPEN_SOURCE) && _XOPEN_SOURCE+0 < 700) || (defined(_XOPEN_SOURCE) && _XOPEN_SOURCE+0 < 700)
struct hostent *gethostbyname (const char *); struct hostent *gethostbyname (const char *);
struct hostent *gethostbyaddr (const void *, socklen_t, int); struct hostent *gethostbyaddr (const void *, socklen_t, int);
#ifdef __GNUC__
__attribute__((const))
#endif
int *__h_errno_location(void); int *__h_errno_location(void);
#define h_errno (*__h_errno_location()) #define h_errno (*__h_errno_location())
#define HOST_NOT_FOUND 1 #define HOST_NOT_FOUND 1
......
...@@ -79,6 +79,9 @@ int pthread_detach(pthread_t); ...@@ -79,6 +79,9 @@ int pthread_detach(pthread_t);
_Noreturn void pthread_exit(void *); _Noreturn 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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册