summaryrefslogtreecommitdiffstats
path: root/tools/afcclient.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/afcclient.c')
-rw-r--r--tools/afcclient.c18
1 files changed, 9 insertions, 9 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 @@
39#include <dirent.h> 39#include <dirent.h>
40#include <time.h> 40#include <time.h>
41 41
42#ifdef WIN32 42#ifdef _WIN32
43#include <windows.h> 43#include <windows.h>
44#include <sys/time.h> 44#include <sys/time.h>
45#include <conio.h> 45#include <conio.h>
@@ -95,7 +95,7 @@ static size_t curdir_len = 0;
95static int file_exists(const char* path) 95static int file_exists(const char* path)
96{ 96{
97 struct stat tst; 97 struct stat tst;
98#ifdef WIN32 98#ifdef _WIN32
99 return (stat(path, &tst) == 0); 99 return (stat(path, &tst) == 0);
100#else 100#else
101 return (lstat(path, &tst) == 0); 101 return (lstat(path, &tst) == 0);
@@ -105,7 +105,7 @@ static int file_exists(const char* path)
105static int is_directory(const char* path) 105static int is_directory(const char* path)
106{ 106{
107 struct stat tst; 107 struct stat tst;
108#ifdef WIN32 108#ifdef _WIN32
109 return (stat(path, &tst) == 0) && S_ISDIR(tst.st_mode); 109 return (stat(path, &tst) == 0) && S_ISDIR(tst.st_mode);
110#else 110#else
111 return (lstat(path, &tst) == 0) && S_ISDIR(tst.st_mode); 111 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)
138} 138}
139 139
140#ifndef HAVE_READLINE 140#ifndef HAVE_READLINE
141#ifdef WIN32 141#ifdef _WIN32
142#define BS_CC '\b' 142#define BS_CC '\b'
143#else 143#else
144#define BS_CC 0x7f 144#define BS_CC 0x7f
@@ -175,7 +175,7 @@ int stop_requested = 0;
175static void handle_signal(int sig) 175static void handle_signal(int sig)
176{ 176{
177 stop_requested++; 177 stop_requested++;
178#ifdef WIN32 178#ifdef _WIN32
179 GenerateConsoleCtrlEvent(CTRL_C_EVENT, 0); 179 GenerateConsoleCtrlEvent(CTRL_C_EVENT, 0);
180#else 180#else
181 kill(getpid(), SIGINT); 181 kill(getpid(), SIGINT);
@@ -483,7 +483,7 @@ static void print_file_info(afc_client_t afc, const char* path, int list_verbose
483 printf(" "); 483 printf(" ");
484 printf("%10lld", (long long)st.st_size); 484 printf("%10lld", (long long)st.st_size);
485 printf(" "); 485 printf(" ");
486#ifdef WIN32 486#ifdef _WIN32
487 strftime(timebuf, 64, "%d %b %Y %H:%M:%S", localtime(&t)); 487 strftime(timebuf, 64, "%d %b %Y %H:%M:%S", localtime(&t));
488#else 488#else
489 strftime(timebuf, 64, "%d %h %Y %H:%M:%S", localtime(&t)); 489 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
774 774
775static int __mkdir(const char* path) 775static int __mkdir(const char* path)
776{ 776{
777#ifdef WIN32 777#ifdef _WIN32
778 return mkdir(path); 778 return mkdir(path);
779#else 779#else
780 return mkdir(path, 0755); 780 return mkdir(path, 0755);
@@ -1483,7 +1483,7 @@ int main(int argc, char** argv)
1483 }; 1483 };
1484 1484
1485 signal(SIGTERM, handle_signal); 1485 signal(SIGTERM, handle_signal);
1486#ifndef WIN32 1486#ifndef _WIN32
1487 signal(SIGQUIT, handle_signal); 1487 signal(SIGQUIT, handle_signal);
1488 signal(SIGPIPE, SIG_IGN); 1488 signal(SIGPIPE, SIG_IGN);
1489#endif 1489#endif
@@ -1561,7 +1561,7 @@ int main(int argc, char** argv)
1561 idevice_events_subscribe(&context, device_event_cb, NULL); 1561 idevice_events_subscribe(&context, device_event_cb, NULL);
1562 1562
1563 while (!connected && !stop_requested) { 1563 while (!connected && !stop_requested) {
1564#ifdef WIN32 1564#ifdef _WIN32
1565 Sleep(100); 1565 Sleep(100);
1566#else 1566#else
1567 usleep(100000); 1567 usleep(100000);