Skip to content

Commit

Permalink
Change WIN32 to _WIN32
Browse files Browse the repository at this point in the history
  • Loading branch information
mrexodia authored and nikias committed Nov 29, 2024
1 parent dd0d0d4 commit cdede2b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 14 deletions.
2 changes: 1 addition & 1 deletion include/usbmuxd-proto.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include <stdint.h>
#define USBMUXD_PROTOCOL_VERSION 0

#if defined(WIN32) || defined(__CYGWIN__)
#if defined(_WIN32) || defined(__CYGWIN__)
#define USBMUXD_SOCKET_PORT 27015
#else
#define USBMUXD_SOCKET_FILE "/var/run/usbmuxd"
Expand Down
13 changes: 6 additions & 7 deletions src/libusbmuxd.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,15 @@
#define ECONNREFUSED 107
#endif

#include <unistd.h>
#include <signal.h>

#ifdef WIN32
#ifdef _WIN32
#include <winsock2.h>
#include <windows.h>
#ifndef HAVE_SLEEP
#define sleep(x) Sleep(x*1000)
#endif
#else
#include <unistd.h>
#include <signal.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#if defined(HAVE_PROGRAM_INVOCATION_SHORT_NAME) && !defined(HAVE_PROGRAM_INVOCATION_SHORT_NAME_ERRNO_H)
Expand Down Expand Up @@ -164,7 +163,7 @@ static int connect_usbmuxd_socket()
char *usbmuxd_socket_addr = getenv("USBMUXD_SOCKET_ADDRESS");
if (usbmuxd_socket_addr) {
if (strncmp(usbmuxd_socket_addr, "UNIX:", 5) == 0) {
#if defined(WIN32) || defined(__CYGWIN__)
#if defined(_WIN32) || defined(__CYGWIN__)
/* not supported, ignore */
#else
if (usbmuxd_socket_addr[5] != '\0') {
Expand Down Expand Up @@ -215,7 +214,7 @@ static int connect_usbmuxd_socket()
}
}
}
#if defined(WIN32) || defined(__CYGWIN__)
#if defined(_WIN32) || defined(__CYGWIN__)
res = socket_connect("127.0.0.1", USBMUXD_SOCKET_PORT);
#else
res = socket_connect_unix(USBMUXD_SOCKET_FILE);
Expand Down Expand Up @@ -660,7 +659,7 @@ static void get_prog_name()
if (pname) {
prog_name = strdup(pname);
}
#elif defined (WIN32)
#elif defined (_WIN32)
TCHAR *_pname = malloc((MAX_PATH+1) * sizeof(TCHAR));
if (GetModuleFileName(NULL, _pname, MAX_PATH+1) > 0) {
char* pname = NULL;
Expand Down
6 changes: 3 additions & 3 deletions tools/inetcat.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
#include <unistd.h>
#include <errno.h>
#include <getopt.h>
#ifdef WIN32
#ifdef _WIN32
#include <winsock2.h>
#include <windows.h>
#else
Expand All @@ -54,7 +54,7 @@ static int debug_level = 0;

static size_t read_data_socket(int fd, uint8_t* buf, size_t bufsize)
{
#ifdef WIN32
#ifdef _WIN32
u_long bytesavailable = 0;
if (fd == STDIN_FILENO) {
bytesavailable = bufsize;
Expand Down Expand Up @@ -166,7 +166,7 @@ int main(int argc, char **argv)
return -EINVAL;
}

#ifndef WIN32
#ifndef _WIN32
signal(SIGPIPE, SIG_IGN);
#endif

Expand Down
6 changes: 3 additions & 3 deletions tools/iproxy.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
#include <unistd.h>
#include <errno.h>
#include <getopt.h>
#ifdef WIN32
#ifdef _WIN32
#include <winsock2.h>
#include <windows.h>
typedef unsigned int socklen_t;
Expand Down Expand Up @@ -370,7 +370,7 @@ int main(int argc, char **argv)
return -1;
}

#ifndef WIN32
#ifndef _WIN32
signal(SIGPIPE, SIG_IGN);
#endif

Expand Down Expand Up @@ -412,7 +412,7 @@ int main(int argc, char **argv)
fd_set fds;
FD_ZERO(&fds);
for (i = 0; i < num_listen; i++) {
#ifdef WIN32
#ifdef _WIN32
u_long l_yes = 1;
ioctlsocket(listen_sock[i].fd, FIONBIO, &l_yes);
#else
Expand Down

0 comments on commit cdede2b

Please sign in to comment.