diff options
author | 2024-11-27 12:01:18 +0100 | |
---|---|---|
committer | 2024-11-29 14:36:34 +0100 | |
commit | bcced6c4f6a79e09ed3961632b2faf81fe873137 (patch) | |
tree | 71bb6a70a3438c68229e4906e6bce14974a9aee8 /tools | |
parent | ba829e6f1a62bdad7866572d1e2cff1836ced742 (diff) | |
download | libimobiledevice-bcced6c4f6a79e09ed3961632b2faf81fe873137.tar.gz libimobiledevice-bcced6c4f6a79e09ed3961632b2faf81fe873137.tar.bz2 |
Fix attempts to detect Windows using _WIN32
Diffstat (limited to 'tools')
-rw-r--r-- | tools/afcclient.c | 18 | ||||
-rw-r--r-- | tools/idevicebackup.c | 6 | ||||
-rw-r--r-- | tools/idevicebackup2.c | 22 | ||||
-rw-r--r-- | tools/idevicebtlogger.c | 4 | ||||
-rw-r--r-- | tools/idevicecrashreport.c | 14 | ||||
-rw-r--r-- | tools/idevicedate.c | 6 | ||||
-rw-r--r-- | tools/idevicedebug.c | 4 | ||||
-rw-r--r-- | tools/idevicedebugserverproxy.c | 4 | ||||
-rw-r--r-- | tools/idevicedevmodectl.c | 6 | ||||
-rw-r--r-- | tools/idevicediagnostics.c | 4 | ||||
-rw-r--r-- | tools/ideviceenterrecovery.c | 4 | ||||
-rw-r--r-- | tools/ideviceimagemounter.c | 4 | ||||
-rw-r--r-- | tools/ideviceinfo.c | 4 | ||||
-rw-r--r-- | tools/idevicename.c | 4 | ||||
-rw-r--r-- | tools/idevicenotificationproxy.c | 4 | ||||
-rw-r--r-- | tools/idevicepair.c | 6 | ||||
-rw-r--r-- | tools/ideviceprovision.c | 6 | ||||
-rw-r--r-- | tools/idevicescreenshot.c | 4 | ||||
-rw-r--r-- | tools/idevicesyslog.c | 4 |
19 files changed, 64 insertions, 64 deletions
diff --git a/tools/afcclient.c b/tools/afcclient.c index 8f49831..1c14bf2 100644 --- a/tools/afcclient.c +++ b/tools/afcclient.c @@ -39,7 +39,7 @@ #include <dirent.h> #include <time.h> -#ifdef WIN32 +#ifdef _WIN32 #include <windows.h> #include <sys/time.h> #include <conio.h> @@ -95,7 +95,7 @@ static size_t curdir_len = 0; static int file_exists(const char* path) { struct stat tst; -#ifdef WIN32 +#ifdef _WIN32 return (stat(path, &tst) == 0); #else return (lstat(path, &tst) == 0); @@ -105,7 +105,7 @@ static int file_exists(const char* path) static int is_directory(const char* path) { struct stat tst; -#ifdef WIN32 +#ifdef _WIN32 return (stat(path, &tst) == 0) && S_ISDIR(tst.st_mode); #else return (lstat(path, &tst) == 0) && S_ISDIR(tst.st_mode); @@ -138,7 +138,7 @@ static void print_usage(int argc, char **argv, int is_error) } #ifndef HAVE_READLINE -#ifdef WIN32 +#ifdef _WIN32 #define BS_CC '\b' #else #define BS_CC 0x7f @@ -175,7 +175,7 @@ int stop_requested = 0; static void handle_signal(int sig) { stop_requested++; -#ifdef WIN32 +#ifdef _WIN32 GenerateConsoleCtrlEvent(CTRL_C_EVENT, 0); #else kill(getpid(), SIGINT); @@ -483,7 +483,7 @@ static void print_file_info(afc_client_t afc, const char* path, int list_verbose printf(" "); printf("%10lld", (long long)st.st_size); printf(" "); -#ifdef WIN32 +#ifdef _WIN32 strftime(timebuf, 64, "%d %b %Y %H:%M:%S", localtime(&t)); #else strftime(timebuf, 64, "%d %h %Y %H:%M:%S", localtime(&t)); @@ -774,7 +774,7 @@ static uint8_t get_single_file(afc_client_t afc, const char *srcpath, const char static int __mkdir(const char* path) { -#ifdef WIN32 +#ifdef _WIN32 return mkdir(path); #else return mkdir(path, 0755); @@ -1483,7 +1483,7 @@ int main(int argc, char** argv) }; signal(SIGTERM, handle_signal); -#ifndef WIN32 +#ifndef _WIN32 signal(SIGQUIT, handle_signal); signal(SIGPIPE, SIG_IGN); #endif @@ -1561,7 +1561,7 @@ int main(int argc, char** argv) idevice_events_subscribe(&context, device_event_cb, NULL); while (!connected && !stop_requested) { -#ifdef WIN32 +#ifdef _WIN32 Sleep(100); #else usleep(100000); diff --git a/tools/idevicebackup.c b/tools/idevicebackup.c index c0537b8..5de2d68 100644 --- a/tools/idevicebackup.c +++ b/tools/idevicebackup.c @@ -51,7 +51,7 @@ #define LOCK_ATTEMPTS 50 #define LOCK_WAIT 200000 -#ifdef WIN32 +#ifdef _WIN32 #include <windows.h> #define sleep(x) Sleep(x*1000) #endif @@ -642,7 +642,7 @@ int main(int argc, char *argv[]) /* we need to exit cleanly on running backups and restores or we cause havok */ signal(SIGINT, clean_exit); signal(SIGTERM, clean_exit); -#ifndef WIN32 +#ifndef _WIN32 signal(SIGQUIT, clean_exit); signal(SIGPIPE, SIG_IGN); #endif @@ -1352,7 +1352,7 @@ files_out: file_info_path = mobilebackup_build_path(backup_directory, hash, ".mddata"); /* determine file size */ -#ifdef WIN32 +#ifdef _WIN32 struct _stati64 fst; if (_stati64(file_info_path, &fst) != 0) #else diff --git a/tools/idevicebackup2.c b/tools/idevicebackup2.c index 19d21a6..804f9f4 100644 --- a/tools/idevicebackup2.c +++ b/tools/idevicebackup2.c @@ -54,7 +54,7 @@ #define LOCK_ATTEMPTS 50 #define LOCK_WAIT 200000 -#ifdef WIN32 +#ifdef _WIN32 #include <windows.h> #include <conio.h> #define sleep(x) Sleep(x*1000) @@ -178,7 +178,7 @@ static void mobilebackup_afc_get_file_contents(afc_client_t afc, const char *fil static int __mkdir(const char* path, int mode) { -#ifdef WIN32 +#ifdef _WIN32 return mkdir(path); #else return mkdir(path, mode); @@ -207,7 +207,7 @@ static int mkdir_with_parents(const char *dir, int mode) return res; } -#ifdef WIN32 +#ifdef _WIN32 static int win32err_to_errno(int err_value) { switch (err_value) { @@ -224,7 +224,7 @@ static int win32err_to_errno(int err_value) static int remove_file(const char* path) { int e = 0; -#ifdef WIN32 +#ifdef _WIN32 if (!DeleteFile(path)) { e = win32err_to_errno(GetLastError()); } @@ -239,7 +239,7 @@ static int remove_file(const char* path) static int remove_directory(const char* path) { int e = 0; -#ifdef WIN32 +#ifdef _WIN32 if (!RemoveDirectory(path)) { e = win32err_to_errno(GetLastError()); } @@ -773,7 +773,7 @@ static int mb2_handle_send_file(mobilebackup2_client_t mobilebackup2, const char uint32_t bytes = 0; char *localfile = string_build_path(backup_dir, path, NULL); char buf[32768]; -#ifdef WIN32 +#ifdef _WIN32 struct _stati64 fst; #else struct stat fst; @@ -784,7 +784,7 @@ static int mb2_handle_send_file(mobilebackup2_client_t mobilebackup2, const char int errcode = -1; int result = -1; uint32_t length; -#ifdef WIN32 +#ifdef _WIN32 uint64_t total; uint64_t sent; #else @@ -815,7 +815,7 @@ static int mb2_handle_send_file(mobilebackup2_client_t mobilebackup2, const char goto leave_proto_err; } -#ifdef WIN32 +#ifdef _WIN32 if (_stati64(localfile, &fst) < 0) #else if (stat(localfile, &fst) < 0) @@ -1348,7 +1348,7 @@ static void mb2_copy_directory_by_path(const char *src, const char *dst) } } -#ifdef WIN32 +#ifdef _WIN32 #define BS_CC '\b' #define my_getch getch #else @@ -1535,7 +1535,7 @@ int main(int argc, char *argv[]) /* we need to exit cleanly on running backups and restores or we cause havok */ signal(SIGINT, clean_exit); signal(SIGTERM, clean_exit); -#ifndef WIN32 +#ifndef _WIN32 signal(SIGQUIT, clean_exit); signal(SIGPIPE, SIG_IGN); #endif @@ -2324,7 +2324,7 @@ checkpoint: /* device wants to know how much disk space is available on the computer */ uint64_t freespace = 0; int res = -1; -#ifdef WIN32 +#ifdef _WIN32 if (GetDiskFreeSpaceEx(backup_directory, (PULARGE_INTEGER)&freespace, NULL, NULL)) { res = 0; } diff --git a/tools/idevicebtlogger.c b/tools/idevicebtlogger.c index 8de6b22..ca68b59 100644 --- a/tools/idevicebtlogger.c +++ b/tools/idevicebtlogger.c @@ -36,7 +36,7 @@ #include <assert.h> #include <fcntl.h> -#ifdef WIN32 +#ifdef _WIN32 #include <windows.h> #define sleep(x) Sleep(x*1000) #else @@ -334,7 +334,7 @@ int main(int argc, char *argv[]) signal(SIGINT, clean_exit); signal(SIGTERM, clean_exit); -#ifndef WIN32 +#ifndef _WIN32 signal(SIGQUIT, clean_exit); signal(SIGPIPE, SIG_IGN); #endif diff --git a/tools/idevicecrashreport.c b/tools/idevicecrashreport.c index e900fe8..9814b79 100644 --- a/tools/idevicecrashreport.c +++ b/tools/idevicecrashreport.c @@ -31,7 +31,7 @@ #include <string.h> #include <unistd.h> #include <getopt.h> -#ifndef WIN32 +#ifndef _WIN32 #include <signal.h> #endif #include <libimobiledevice-glue/utils.h> @@ -42,7 +42,7 @@ #include <libimobiledevice/afc.h> #include <plist/plist.h> -#ifdef WIN32 +#ifdef _WIN32 #include <windows.h> #define S_IFLNK S_IFREG #define S_IFSOCK S_IFREG @@ -59,7 +59,7 @@ static int remove_all = 0; static int file_exists(const char* path) { struct stat tst; -#ifdef WIN32 +#ifdef _WIN32 return (stat(path, &tst) == 0); #else return (lstat(path, &tst) == 0); @@ -153,7 +153,7 @@ static int afc_client_copy_and_remove_crash_reports(afc_client_t afc, const char strcpy(((char*)source_filename) + device_directory_length, list[k]); /* assemble absolute target filename */ -#ifdef WIN32 +#ifdef _WIN32 /* replace every ':' with '-' since ':' is an illegal character for file names in windows */ char* current_pos = strchr(list[k], ':'); while (current_pos) { @@ -212,7 +212,7 @@ static int afc_client_copy_and_remove_crash_reports(afc_client_t afc, const char remove(target_filename); } -#ifndef WIN32 +#ifndef _WIN32 /* use relative filename */ char* b = strrchr(fileinfo[i+1], '/'); if (b == NULL) { @@ -240,7 +240,7 @@ static int afc_client_copy_and_remove_crash_reports(afc_client_t afc, const char /* recurse into child directories */ if (S_ISDIR(stbuf.st_mode)) { if (!remove_all) { -#ifdef WIN32 +#ifdef _WIN32 mkdir(target_filename); #else mkdir(target_filename, 0755); @@ -375,7 +375,7 @@ int main(int argc, char* argv[]) { NULL, 0, NULL, 0} }; -#ifndef WIN32 +#ifndef _WIN32 signal(SIGPIPE, SIG_IGN); #endif diff --git a/tools/idevicedate.c b/tools/idevicedate.c index d05f63e..31b0cf7 100644 --- a/tools/idevicedate.c +++ b/tools/idevicedate.c @@ -33,7 +33,7 @@ #if HAVE_LANGINFO_CODESET #include <langinfo.h> #endif -#ifndef WIN32 +#ifndef _WIN32 #include <signal.h> #endif @@ -43,7 +43,7 @@ #ifdef _DATE_FMT #define DATE_FMT_LANGINFO nl_langinfo (_DATE_FMT) #else -#ifdef WIN32 +#ifdef _WIN32 #define DATE_FMT_LANGINFO "%a %b %#d %H:%M:%S %Z %Y" #else #define DATE_FMT_LANGINFO "%a %b %e %H:%M:%S %Z %Y" @@ -104,7 +104,7 @@ int main(int argc, char *argv[]) { NULL, 0, NULL, 0} }; -#ifndef WIN32 +#ifndef _WIN32 signal(SIGPIPE, SIG_IGN); #endif /* parse cmdline args */ diff --git a/tools/idevicedebug.c b/tools/idevicedebug.c index 36c594e..3f2e289 100644 --- a/tools/idevicedebug.c +++ b/tools/idevicedebug.c @@ -34,7 +34,7 @@ #include <libgen.h> #include <getopt.h> -#ifdef WIN32 +#ifdef _WIN32 #include <windows.h> #define sleep(x) Sleep(x*1000) #endif @@ -239,7 +239,7 @@ int main(int argc, char *argv[]) /* map signals */ signal(SIGINT, on_signal); signal(SIGTERM, on_signal); -#ifndef WIN32 +#ifndef _WIN32 signal(SIGQUIT, on_signal); signal(SIGPIPE, SIG_IGN); #endif diff --git a/tools/idevicedebugserverproxy.c b/tools/idevicedebugserverproxy.c index 9fe7051..fb082b3 100644 --- a/tools/idevicedebugserverproxy.c +++ b/tools/idevicedebugserverproxy.c @@ -32,7 +32,7 @@ #include <getopt.h> #include <errno.h> #include <signal.h> -#ifdef WIN32 +#ifdef _WIN32 #include <winsock2.h> #include <windows.h> #else @@ -219,7 +219,7 @@ int main(int argc, char *argv[]) { NULL, 0, NULL, 0} }; -#ifndef WIN32 +#ifndef _WIN32 struct sigaction sa; struct sigaction si; memset(&sa, '\0', sizeof(struct sigaction)); diff --git a/tools/idevicedevmodectl.c b/tools/idevicedevmodectl.c index bd1de6a..6bf1a1c 100644 --- a/tools/idevicedevmodectl.c +++ b/tools/idevicedevmodectl.c @@ -32,11 +32,11 @@ #include <sys/stat.h> #include <unistd.h> #include <errno.h> -#ifndef WIN32 +#ifndef _WIN32 #include <signal.h> #endif -#ifdef WIN32 +#ifdef _WIN32 #include <windows.h> #define __usleep(x) Sleep(x/1000) #else @@ -259,7 +259,7 @@ int main(int argc, char *argv[]) { NULL, 0, NULL, 0} }; -#ifndef WIN32 +#ifndef _WIN32 signal(SIGPIPE, SIG_IGN); #endif /* parse cmdline args */ diff --git a/tools/idevicediagnostics.c b/tools/idevicediagnostics.c index e699bc4..365c0a4 100644 --- a/tools/idevicediagnostics.c +++ b/tools/idevicediagnostics.c @@ -31,7 +31,7 @@ #include <getopt.h> #include <errno.h> #include <time.h> -#ifndef WIN32 +#ifndef _WIN32 #include <signal.h> #endif @@ -113,7 +113,7 @@ int main(int argc, char **argv) { NULL, 0, NULL, 0} }; -#ifndef WIN32 +#ifndef _WIN32 signal(SIGPIPE, SIG_IGN); #endif /* parse cmdline args */ diff --git a/tools/ideviceenterrecovery.c b/tools/ideviceenterrecovery.c index 29cc5c9..65eb882 100644 --- a/tools/ideviceenterrecovery.c +++ b/tools/ideviceenterrecovery.c @@ -30,7 +30,7 @@ #include <stdlib.h> #include <getopt.h> #include <errno.h> -#ifndef WIN32 +#ifndef _WIN32 #include <signal.h> #endif @@ -70,7 +70,7 @@ int main(int argc, char *argv[]) { NULL, 0, NULL, 0} }; -#ifndef WIN32 +#ifndef _WIN32 signal(SIGPIPE, SIG_IGN); #endif /* parse cmdline args */ diff --git a/tools/ideviceimagemounter.c b/tools/ideviceimagemounter.c index 511583e..8d6fc95 100644 --- a/tools/ideviceimagemounter.c +++ b/tools/ideviceimagemounter.c @@ -36,7 +36,7 @@ #include <time.h> #include <sys/time.h> #include <inttypes.h> -#ifndef WIN32 +#ifndef _WIN32 #include <signal.h> #endif @@ -183,7 +183,7 @@ int main(int argc, char **argv) size_t image_size = 0; char *image_sig_path = NULL; -#ifndef WIN32 +#ifndef _WIN32 signal(SIGPIPE, SIG_IGN); #endif parse_opts(argc, argv); diff --git a/tools/ideviceinfo.c b/tools/ideviceinfo.c index fd45763..20cc916 100644 --- a/tools/ideviceinfo.c +++ b/tools/ideviceinfo.c @@ -31,7 +31,7 @@ #include <errno.h> #include <stdlib.h> #include <getopt.h> -#ifndef WIN32 +#ifndef _WIN32 #include <signal.h> #endif @@ -152,7 +152,7 @@ int main(int argc, char *argv[]) { NULL, 0, NULL, 0} }; -#ifndef WIN32 +#ifndef _WIN32 signal(SIGPIPE, SIG_IGN); #endif diff --git a/tools/idevicename.c b/tools/idevicename.c index 69b76f6..248bda3 100644 --- a/tools/idevicename.c +++ b/tools/idevicename.c @@ -30,7 +30,7 @@ #include <unistd.h> #include <stdlib.h> #include <getopt.h> -#ifndef WIN32 +#ifndef _WIN32 #include <signal.h> #endif @@ -72,7 +72,7 @@ int main(int argc, char** argv) const char* udid = NULL; int use_network = 0; -#ifndef WIN32 +#ifndef _WIN32 signal(SIGPIPE, SIG_IGN); #endif diff --git a/tools/idevicenotificationproxy.c b/tools/idevicenotificationproxy.c index 00da916..192192a 100644 --- a/tools/idevicenotificationproxy.c +++ b/tools/idevicenotificationproxy.c @@ -33,7 +33,7 @@ #include <errno.h> #include <signal.h> -#ifdef WIN32 +#ifdef _WIN32 #include <windows.h> #define sleep(x) Sleep(x*1000) #else @@ -125,7 +125,7 @@ int main(int argc, char *argv[]) signal(SIGINT, clean_exit); signal(SIGTERM, clean_exit); -#ifndef WIN32 +#ifndef _WIN32 signal(SIGQUIT, clean_exit); signal(SIGPIPE, SIG_IGN); #endif diff --git a/tools/idevicepair.c b/tools/idevicepair.c index 94d3f04..884c690 100644 --- a/tools/idevicepair.c +++ b/tools/idevicepair.c @@ -32,7 +32,7 @@ #include <getopt.h> #include <ctype.h> #include <unistd.h> -#ifdef WIN32 +#ifdef _WIN32 #include <windows.h> #include <conio.h> #else @@ -50,7 +50,7 @@ static char *udid = NULL; #ifdef HAVE_WIRELESS_PAIRING -#ifdef WIN32 +#ifdef _WIN32 #define BS_CC '\b' #define my_getch getch #else @@ -293,7 +293,7 @@ int main(int argc, char **argv) } } -#ifndef WIN32 +#ifndef _WIN32 signal(SIGPIPE, SIG_IGN); #endif diff --git a/tools/ideviceprovision.c b/tools/ideviceprovision.c index 4080a28..97417eb 100644 --- a/tools/ideviceprovision.c +++ b/tools/ideviceprovision.c @@ -32,11 +32,11 @@ #include <getopt.h> #include <sys/stat.h> #include <errno.h> -#ifndef WIN32 +#ifndef _WIN32 #include <signal.h> #endif -#ifdef WIN32 +#ifdef _WIN32 #include <windows.h> #else #include <arpa/inet.h> @@ -314,7 +314,7 @@ int main(int argc, char *argv[]) { NULL, 0, NULL, 0} }; -#ifndef WIN32 +#ifndef _WIN32 signal(SIGPIPE, SIG_IGN); #endif /* parse cmdline args */ diff --git a/tools/idevicescreenshot.c b/tools/idevicescreenshot.c index 0e694c7..bfaa059 100644 --- a/tools/idevicescreenshot.c +++ b/tools/idevicescreenshot.c @@ -32,7 +32,7 @@ #include <errno.h> #include <time.h> #include <unistd.h> -#ifndef WIN32 +#ifndef _WIN32 #include <signal.h> #endif @@ -142,7 +142,7 @@ int main(int argc, char **argv) { NULL, 0, NULL, 0} }; -#ifndef WIN32 +#ifndef _WIN32 signal(SIGPIPE, SIG_IGN); #endif /* parse cmdline args */ diff --git a/tools/idevicesyslog.c b/tools/idevicesyslog.c index a0e641d..dbd7b01 100644 --- a/tools/idevicesyslog.c +++ b/tools/idevicesyslog.c @@ -34,7 +34,7 @@ #include <unistd.h> #include <getopt.h> -#ifdef WIN32 +#ifdef _WIN32 #include <windows.h> #define sleep(x) Sleep(x*1000) #endif @@ -537,7 +537,7 @@ int main(int argc, char *argv[]) signal(SIGINT, clean_exit); signal(SIGTERM, clean_exit); -#ifndef WIN32 +#ifndef _WIN32 signal(SIGQUIT, clean_exit); signal(SIGPIPE, SIG_IGN); #endif |