mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-04 18:28:30 +00:00
Add dontthrow
attribute to most libc functions
This will help C++ code that uses exceptions to be tinier. For example, this change shaves away 1000 lines of assembly code from LLVM's libcxx, which is 0.7% of all assembly instructions in the entire library.
This commit is contained in:
parent
cb19e172da
commit
eeb20775d2
103 changed files with 1455 additions and 1456 deletions
|
@ -15,10 +15,10 @@ struct thatispacked epoll_event {
|
|||
epoll_data_t data;
|
||||
};
|
||||
|
||||
int epoll_create(int);
|
||||
int epoll_create1(int);
|
||||
int epoll_ctl(int, int, int, struct epoll_event *);
|
||||
int epoll_wait(int, struct epoll_event *, int, int);
|
||||
int epoll_create(int) libcesque;
|
||||
int epoll_create1(int) libcesque;
|
||||
int epoll_ctl(int, int, int, struct epoll_event *) libcesque;
|
||||
int epoll_wait(int, struct epoll_event *, int, int) libcesque;
|
||||
int epoll_pwait(int, struct epoll_event *, int, int, const sigset_t *);
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#include "libc/calls/struct/timeval.h"
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
int GoodSocket(int, int, int, bool, const struct timeval *);
|
||||
int GoodSocket(int, int, int, bool, const struct timeval *) libcesque;
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* COSMOPOLITAN_LIBC_SOCK_GOODSOCKET_H_ */
|
||||
|
|
|
@ -16,8 +16,8 @@ struct ifaddrs {
|
|||
void *ifa_data;
|
||||
};
|
||||
|
||||
void freeifaddrs(struct ifaddrs *);
|
||||
int getifaddrs(struct ifaddrs **);
|
||||
void freeifaddrs(struct ifaddrs *) libcesque;
|
||||
int getifaddrs(struct ifaddrs **) libcesque;
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* COSMOPOLITAN_LIBC_SOCK_IFADDRS_H_ */
|
||||
|
|
|
@ -19,9 +19,9 @@ typedef struct fd_set {
|
|||
#define FD_ZERO(SET) bzero((SET)->fds_bits, sizeof((SET)->fds_bits))
|
||||
#define FD_SIZE(bits) (((bits) + (sizeof(long) * 8) - 1) / sizeof(long))
|
||||
|
||||
int select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
|
||||
int select(int, fd_set *, fd_set *, fd_set *, struct timeval *) libcesque;
|
||||
int pselect(int, fd_set *, fd_set *, fd_set *, const struct timespec *,
|
||||
const sigset_t *);
|
||||
const sigset_t *) libcesque;
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* COSMOPOLITAN_LIBC_SOCK_SELECT_H_ */
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#include "libc/sock/select.h"
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
const char *DescribeFdSet(char[100], ssize_t, int, fd_set *);
|
||||
const char *DescribeFdSet(char[100], ssize_t, int, fd_set *) libcesque;
|
||||
#define DescribeFdSet(x, y, z) DescribeFdSet(alloca(100), x, y, z)
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
|
|
|
@ -5,10 +5,10 @@ COSMOPOLITAN_C_START_
|
|||
#define INET_ADDRSTRLEN 22
|
||||
#define IFHWADDRLEN 6
|
||||
|
||||
uint16_t htons(uint16_t) pureconst;
|
||||
uint16_t ntohs(uint16_t) pureconst;
|
||||
uint32_t htonl(uint32_t) pureconst;
|
||||
uint32_t ntohl(uint32_t) pureconst;
|
||||
libcesque uint16_t htons(uint16_t) pureconst;
|
||||
libcesque uint16_t ntohs(uint16_t) pureconst;
|
||||
libcesque uint32_t htonl(uint32_t) pureconst;
|
||||
libcesque uint32_t ntohl(uint32_t) pureconst;
|
||||
|
||||
#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
|
||||
#define htons(x) __builtin_bswap16(x)
|
||||
|
@ -17,21 +17,21 @@ uint32_t ntohl(uint32_t) pureconst;
|
|||
#define ntohl(x) __builtin_bswap32(x)
|
||||
#endif
|
||||
|
||||
const char *inet_ntop(int, const void *, char *, uint32_t);
|
||||
int inet_pton(int, const char *, void *);
|
||||
uint32_t inet_addr(const char *);
|
||||
uint32_t *GetHostIps(void);
|
||||
const char *inet_ntop(int, const void *, char *, uint32_t) libcesque;
|
||||
int inet_pton(int, const char *, void *) libcesque;
|
||||
uint32_t inet_addr(const char *) libcesque;
|
||||
libcesque uint32_t *GetHostIps(void) __wur;
|
||||
|
||||
int socket(int, int, int);
|
||||
int listen(int, int);
|
||||
int shutdown(int, int);
|
||||
ssize_t send(int, const void *, size_t, int);
|
||||
ssize_t recv(int, void *, size_t, int);
|
||||
ssize_t sendfile(int, int, int64_t *, size_t);
|
||||
int getsockopt(int, int, int, void *, uint32_t *);
|
||||
int setsockopt(int, int, int, const void *, uint32_t);
|
||||
int socketpair(int, int, int, int[2]);
|
||||
int sockatmark(int);
|
||||
int socket(int, int, int) libcesque;
|
||||
int listen(int, int) libcesque;
|
||||
int shutdown(int, int) libcesque;
|
||||
ssize_t send(int, const void *, size_t, int) libcesque;
|
||||
ssize_t recv(int, void *, size_t, int) libcesque;
|
||||
ssize_t sendfile(int, int, int64_t *, size_t) libcesque;
|
||||
int getsockopt(int, int, int, void *, uint32_t *) libcesque;
|
||||
int setsockopt(int, int, int, const void *, uint32_t) libcesque;
|
||||
int socketpair(int, int, int, int[2]) libcesque;
|
||||
int sockatmark(int) libcesque;
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* COSMOPOLITAN_LIBC_SOCK_SOCK_H_ */
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
#define COSMOPOLITAN_LIBC_SOCK_SYSLOG_H_
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
int setlogmask(int);
|
||||
void openlog(const char *, int, int);
|
||||
void syslog(int, const char *, ...);
|
||||
void closelog(void);
|
||||
void vsyslog(int, const char *, va_list);
|
||||
int setlogmask(int) libcesque;
|
||||
void openlog(const char *, int, int) libcesque;
|
||||
void syslog(int, const char *, ...) libcesque;
|
||||
void closelog(void) libcesque;
|
||||
void vsyslog(int, const char *, va_list) libcesque;
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* COSMOPOLITAN_LIBC_SOCK_SYSLOG_H_ */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue