pidgin/pidgin

remove wpurple_strerror

2020-10-14, Gary Kramlich
5c44a08bdbcd
Parents 3fb07a4b34dd
Children 7aaabf0b8500
remove wpurple_strerror

Remove the strerror and g_strerror replacements

Testing Done:
Compiled on linux and windows, verified no new errors on windows.

Reviewed at https://reviews.imfreedom.org/r/165/
--- a/libpurple/win32/libc_interface.c Tue Oct 13 21:26:55 2020 -0500
+++ b/libpurple/win32/libc_interface.c Wed Oct 14 00:40:50 2020 -0500
@@ -42,8 +42,6 @@
# define S_ISDIR(m) (((m)&S_IFDIR)==S_IFDIR)
#endif
-static char errbuf[1024];
-
/* helpers */
static int wpurple_is_socket( int fd ) {
int optval;
@@ -341,35 +339,6 @@
return hp;
}
-/* string.h */
-char* wpurple_strerror(int errornum) {
- if (errornum > WSABASEERR) {
- switch(errornum) {
- case WSAECONNABORTED: /* 10053 */
- g_snprintf(errbuf, sizeof(errbuf), "%s", _("Connection interrupted by other software on your computer."));
- break;
- case WSAECONNRESET: /* 10054 */
- g_snprintf(errbuf, sizeof(errbuf), "%s", _("Remote host closed connection."));
- break;
- case WSAETIMEDOUT: /* 10060 */
- g_snprintf(errbuf, sizeof(errbuf), "%s", _("Connection timed out."));
- break;
- case WSAECONNREFUSED: /* 10061 */
- g_snprintf(errbuf, sizeof(errbuf), "%s", _("Connection refused."));
- break;
- case WSAEADDRINUSE: /* 10048 */
- g_snprintf(errbuf, sizeof(errbuf), "%s", _("Address already in use."));
- break;
- default:
- g_snprintf(errbuf, sizeof(errbuf), "Windows socket error #%d", errornum);
- }
- } else {
- const char *tmp = g_strerror(errornum);
- g_snprintf(errbuf, sizeof(errbuf), "%s", tmp);
- }
- return errbuf;
-}
-
/* unistd.h */
/*
--- a/libpurple/win32/libc_interface.h Tue Oct 13 21:26:55 2020 -0500
+++ b/libpurple/win32/libc_interface.h Wed Oct 14 00:40:50 2020 -0500
@@ -102,12 +102,6 @@
#define ntohl( netlong ) \
(unsigned int)ntohl( netlong )
-/* string.h */
-#define strerror( errornum ) \
-wpurple_strerror( errornum )
-#define g_strerror( errornum ) \
-wpurple_strerror( errornum )
-
/* unistd.h */
#define read( fd, buf, buflen ) \
wpurple_read( fd, buf, buflen )
--- a/libpurple/win32/libc_internal.h Tue Oct 13 21:26:55 2020 -0500
+++ b/libpurple/win32/libc_internal.h Wed Oct 14 00:40:50 2020 -0500
@@ -47,9 +47,6 @@
/* netdb.h */
struct hostent* wpurple_gethostbyname(const char *name);
-/* string.h */
-char* wpurple_strerror( int errornum );
-
/* fcntl.h */
int wpurple_fcntl(int socket, int command, ...);
#define F_GETFL 3