Replace WIN32 with _WIN32
Using WIN32 depends on the build environment defining the variable. _WIN32 is a predefined MSVC macro and is always available. Signed-off-by: Tim Crawford <crawfxrd@gmail.com>
This commit is contained in:
@@ -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 <winsock2.h>
|
||||
#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);
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
#include <stdint.h>
|
||||
#include <time.h>
|
||||
|
||||
#if defined(WIN32)
|
||||
#if defined(_WIN32)
|
||||
#include <basetsd.h>
|
||||
#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
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
#include <stdint.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#if defined(WIN32)
|
||||
#if defined(_WIN32)
|
||||
#define EXTERN __declspec( dllexport )
|
||||
#else
|
||||
#define EXTERN
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#ifndef MD5_H
|
||||
#define MD5_H
|
||||
|
||||
#if defined(WIN32)
|
||||
#if defined(_WIN32)
|
||||
#else
|
||||
#include <netinet/in.h>
|
||||
#endif
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#if defined(WIN32)
|
||||
#if defined(_WIN32)
|
||||
#include "win32/win32_compat.h"
|
||||
#else
|
||||
#include <unistd.h>
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#if defined(WIN32)
|
||||
#if defined(_WIN32)
|
||||
#else
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
#define _GNU_SOURCE
|
||||
|
||||
#if defined(WIN32)
|
||||
#if defined(_WIN32)
|
||||
#include "win32/win32_compat.h"
|
||||
#else
|
||||
#include <strings.h>
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
#include <arpa/inet.h>
|
||||
#endif
|
||||
|
||||
#if defined(WIN32)
|
||||
#if defined(_WIN32)
|
||||
#include <winsock2.h>
|
||||
#endif
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#if defined(WIN32)
|
||||
#if defined(_WIN32)
|
||||
#include "win32/win32_compat.h"
|
||||
#endif
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
#include <arpa/inet.h>
|
||||
#endif
|
||||
|
||||
#if defined(WIN32)
|
||||
#if defined(_WIN32)
|
||||
#include <winsock2.h>
|
||||
#include "win32/win32_compat.h"
|
||||
#endif
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#if defined(WIN32)
|
||||
#if defined(_WIN32)
|
||||
#else
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
#define PRIx32 "x"
|
||||
#endif
|
||||
|
||||
#if defined(WIN32)
|
||||
#if defined(_WIN32)
|
||||
#include <winsock2.h>
|
||||
#include <ws2tcpip.h>
|
||||
#include "win32/win32_compat.h"
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
#include "aros/aros_compat.h"
|
||||
#endif
|
||||
|
||||
#if defined(WIN32)
|
||||
#if defined(_WIN32)
|
||||
#include <winsock2.h>
|
||||
#include "win32/win32_compat.h"
|
||||
#else
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
#include <sys/socket.h>
|
||||
#endif
|
||||
|
||||
#if defined(WIN32)
|
||||
#if defined(_WIN32)
|
||||
#include <winsock2.h>
|
||||
#include <ws2tcpip.h>
|
||||
#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) {
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
#include "aros/aros_compat.h"
|
||||
#endif
|
||||
|
||||
#if defined(WIN32)
|
||||
#if defined(_WIN32)
|
||||
#include <winsock2.h>
|
||||
#include "win32/win32_compat.h"
|
||||
#endif
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#if defined(WIN32)
|
||||
#if defined(_WIN32)
|
||||
#include <winsock2.h>
|
||||
#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);
|
||||
|
||||
@@ -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));
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ THE SOFTWARE.
|
||||
#ifndef win32_COMPAT_H_
|
||||
#define win32_COMPAT_H_
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
#define NO_IPv6 1
|
||||
|
||||
#include <winsock2.h>
|
||||
@@ -90,5 +90,5 @@ struct iovec {
|
||||
|
||||
#define inline
|
||||
|
||||
#endif // WIN32
|
||||
#endif // _WIN32
|
||||
#endif // win32_COMPAT_H_
|
||||
|
||||
Reference in New Issue
Block a user