From bcced6c4f6a79e09ed3961632b2faf81fe873137 Mon Sep 17 00:00:00 2001 From: Duncan Ogilvie Date: Wed, 27 Nov 2024 12:01:18 +0100 Subject: Fix attempts to detect Windows using _WIN32 --- tools/idevicecrashreport.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'tools/idevicecrashreport.c') 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 #include #include -#ifndef WIN32 +#ifndef _WIN32 #include #endif #include @@ -42,7 +42,7 @@ #include #include -#ifdef WIN32 +#ifdef _WIN32 #include #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 -- cgit v1.1-32-gdbae