diff --git a/examples/iscsiclient.c b/examples/iscsiclient.c index 95dbe87..476a925 100644 --- a/examples/iscsiclient.c +++ b/examples/iscsiclient.c @@ -34,7 +34,7 @@ /* This is the host/port we connect to.*/ #define TARGET "127.0.0.1:3260" -#if defined(WIN32) +#if defined(_WIN32) #include #include "win32/win32_compat.h" #pragma comment(lib, "ws2_32.lib") @@ -625,7 +625,7 @@ int main(int argc _U_, char *argv[] _U_) struct client_state clnt; printf("iscsi client\n"); -#if defined(WIN32) +#if defined(_WIN32) if (WSAStartup(MAKEWORD(2,2), &wsaData) != 0) { printf("Failed to start Winsock2\n"); exit(10); diff --git a/include/iscsi-private.h b/include/iscsi-private.h index a85b4bd..aedbbe0 100644 --- a/include/iscsi-private.h +++ b/include/iscsi-private.h @@ -20,7 +20,7 @@ #include #include -#if defined(WIN32) +#if defined(_WIN32) #include #define ssize_t SSIZE_T #endif @@ -324,7 +324,7 @@ int iscsi_process_reject(struct iscsi_context *iscsi, struct iscsi_in_pdu *in); int iscsi_send_target_nop_out(struct iscsi_context *iscsi, uint32_t ttt, uint32_t lun); -#if defined(WIN32) +#if defined(_WIN32) void iscsi_set_error(struct iscsi_context *iscsi, const char *error_string, ...); #else diff --git a/include/iscsi.h b/include/iscsi.h index 798703c..63fa94b 100644 --- a/include/iscsi.h +++ b/include/iscsi.h @@ -20,7 +20,7 @@ #include #include -#if defined(WIN32) +#if defined(_WIN32) #define EXTERN __declspec( dllexport ) #else #define EXTERN diff --git a/include/md5.h b/include/md5.h index 52ba252..c5cdd0e 100644 --- a/include/md5.h +++ b/include/md5.h @@ -23,7 +23,7 @@ #ifndef MD5_H #define MD5_H -#if defined(WIN32) +#if defined(_WIN32) #else #include #endif diff --git a/include/scsi-lowlevel.h b/include/scsi-lowlevel.h index 2b1e407..f2a8908 100644 --- a/include/scsi-lowlevel.h +++ b/include/scsi-lowlevel.h @@ -17,7 +17,7 @@ #ifndef __scsi_lowlevel_h__ #define __scsi_lowlevel_h__ -#if defined(WIN32) +#if defined(_WIN32) #define EXTERN __declspec( dllexport ) #else #define EXTERN diff --git a/lib/connect.c b/lib/connect.c index 989b924..4043f7c 100644 --- a/lib/connect.c +++ b/lib/connect.c @@ -15,7 +15,7 @@ You should have received a copy of the GNU Lesser General Public License along with this program; if not, see . */ -#if defined(WIN32) +#if defined(_WIN32) #include "win32/win32_compat.h" #else #include diff --git a/lib/crc32c.c b/lib/crc32c.c index 4455171..3c9d6a5 100644 --- a/lib/crc32c.c +++ b/lib/crc32c.c @@ -15,7 +15,7 @@ You should have received a copy of the GNU Lesser General Public License along with this program; if not, see . */ -#if defined(WIN32) +#if defined(_WIN32) #else #include #endif diff --git a/lib/init.c b/lib/init.c index 88bc7eb..34a95a5 100644 --- a/lib/init.c +++ b/lib/init.c @@ -21,7 +21,7 @@ #define _GNU_SOURCE -#if defined(WIN32) +#if defined(_WIN32) #include "win32/win32_compat.h" #else #include diff --git a/lib/iscsi-command.c b/lib/iscsi-command.c index f9ca8e0..5be7ee2 100644 --- a/lib/iscsi-command.c +++ b/lib/iscsi-command.c @@ -27,7 +27,7 @@ #include #endif -#if defined(WIN32) +#if defined(_WIN32) #include #endif diff --git a/lib/logging.c b/lib/logging.c index bc31f24..be518fc 100644 --- a/lib/logging.c +++ b/lib/logging.c @@ -31,7 +31,7 @@ #include #endif -#if defined(WIN32) +#if defined(_WIN32) #include "win32/win32_compat.h" #endif diff --git a/lib/login.c b/lib/login.c index 36de085..e2bb112 100644 --- a/lib/login.c +++ b/lib/login.c @@ -32,7 +32,7 @@ #include #endif -#if defined(WIN32) +#if defined(_WIN32) #include #include "win32/win32_compat.h" #endif diff --git a/lib/nop.c b/lib/nop.c index 6d9f450..b2104cd 100644 --- a/lib/nop.c +++ b/lib/nop.c @@ -16,7 +16,7 @@ along with this program; if not, see . */ -#if defined(WIN32) +#if defined(_WIN32) #else #include #endif diff --git a/lib/pdu.c b/lib/pdu.c index 6fd4b45..0bcbe11 100644 --- a/lib/pdu.c +++ b/lib/pdu.c @@ -34,7 +34,7 @@ #define PRIx32 "x" #endif -#if defined(WIN32) +#if defined(_WIN32) #include #include #include "win32/win32_compat.h" diff --git a/lib/scsi-lowlevel.c b/lib/scsi-lowlevel.c index 0558e5b..d68d990 100644 --- a/lib/scsi-lowlevel.c +++ b/lib/scsi-lowlevel.c @@ -38,7 +38,7 @@ #include "aros/aros_compat.h" #endif -#if defined(WIN32) +#if defined(_WIN32) #include #include "win32/win32_compat.h" #else diff --git a/lib/socket.c b/lib/socket.c index 22e6e57..4aa0d9a 100644 --- a/lib/socket.c +++ b/lib/socket.c @@ -43,7 +43,7 @@ #include #endif -#if defined(WIN32) +#if defined(_WIN32) #include #include #include "win32/win32_compat.h" @@ -139,7 +139,7 @@ void iscsi_decrement_iface_rr() { static int set_nonblocking(int fd) { -#if defined(WIN32) +#if defined(_WIN32) unsigned long opt = 1; return ioctlsocket(fd, FIONBIO, &opt); #else @@ -272,7 +272,7 @@ static int iscsi_tcp_connect(struct iscsi_context *iscsi, union socket_address * } if (connect(iscsi->fd, &sa->sa, socksize) != 0 -#if defined(WIN32) +#if defined(_WIN32) && WSAGetLastError() != WSAEWOULDBLOCK #endif && errno != EINPROGRESS) { diff --git a/lib/sync.c b/lib/sync.c index 1c2084e..ce59c29 100644 --- a/lib/sync.c +++ b/lib/sync.c @@ -27,7 +27,7 @@ #include "aros/aros_compat.h" #endif -#if defined(WIN32) +#if defined(_WIN32) #include #include "win32/win32_compat.h" #endif diff --git a/utils/iscsi-ls.c b/utils/iscsi-ls.c index 2c4dbc6..95ab1a6 100644 --- a/utils/iscsi-ls.c +++ b/utils/iscsi-ls.c @@ -19,7 +19,7 @@ #include "config.h" #endif -#if defined(WIN32) +#if defined(_WIN32) #include #include "win32_compat.h" #pragma comment(lib, "ws2_32.lib") @@ -354,7 +354,7 @@ int main(int argc, char *argv[]) int i; static int show_help = 0, show_usage = 0, debug = 0; -#ifdef WIN32 +#ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != 0) { printf("Failed to start Winsock2\n"); exit(10); diff --git a/win32/win32_compat.c b/win32/win32_compat.c index 8c797be..d6bece5 100644 --- a/win32/win32_compat.c +++ b/win32/win32_compat.c @@ -21,7 +21,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#ifndef WIN32 +#ifndef _WIN32 static int dummy ATTRIBUTE((unused)); diff --git a/win32/win32_compat.h b/win32/win32_compat.h index 8ec388a..f30269a 100644 --- a/win32/win32_compat.h +++ b/win32/win32_compat.h @@ -25,7 +25,7 @@ THE SOFTWARE. #ifndef win32_COMPAT_H_ #define win32_COMPAT_H_ -#ifdef WIN32 +#ifdef _WIN32 #define NO_IPv6 1 #include @@ -90,5 +90,5 @@ struct iovec { #define inline -#endif // WIN32 +#endif // _WIN32 #endif // win32_COMPAT_H_