--- embedaddon/istgt/src/istgt_sock.c 2012/02/21 16:42:02 1.1.1.1 +++ embedaddon/istgt/src/istgt_sock.c 2012/10/09 09:13:23 1.1.1.2 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2010 Daisuke Aoyama . + * Copyright (C) 2008-2012 Daisuke Aoyama . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -54,6 +54,11 @@ #define AI_NUMERICSERV 0 #endif +#if !defined(__GNUC__) +#undef __attribute__ +#define __attribute__(x) +#endif + int istgt_getaddr(int sock, char *saddr, int slen, char *caddr, int clen) { @@ -68,7 +73,7 @@ istgt_getaddr(int sock, char *saddr, int slen, char *c return -1; } rc = getnameinfo((struct sockaddr *) &sa, salen, - saddr, slen, NULL, 0, NI_NUMERICHOST); + saddr, slen, NULL, 0, NI_NUMERICHOST); if (rc != 0) { return -1; } @@ -80,7 +85,7 @@ istgt_getaddr(int sock, char *saddr, int slen, char *c return -1; } rc = getnameinfo((struct sockaddr *) &sa, salen, - caddr, clen, NULL, 0, NI_NUMERICHOST); + caddr, clen, NULL, 0, NI_NUMERICHOST); if (rc != 0) { return -1; } @@ -339,8 +344,14 @@ can_write_socket(int s, int msec) } #endif /* USE_POLLWAIT */ +#ifdef USE_POLLWAIT +#define UNUSED_POLLWAIT(x) x +#else +#define UNUSED_POLLWAIT(x) x __attribute__((__unused__)) +#endif + ssize_t -istgt_read_socket(int s, void *buf, size_t nbytes, int timeout) +istgt_read_socket(int s, void *buf, size_t nbytes, int UNUSED_POLLWAIT(timeout)) { ssize_t n; #ifdef USE_POLLWAIT @@ -387,7 +398,7 @@ istgt_read_socket(int s, void *buf, size_t nbytes, int } ssize_t -istgt_write_socket(int s, const void *buf, size_t nbytes, int timeout) +istgt_write_socket(int s, const void *buf, size_t nbytes, int UNUSED_POLLWAIT(timeout)) { ssize_t n; #ifdef USE_POLLWAIT