From 23abb2405f3401690fef892425afbb364bef3b93 Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Sun, 12 Feb 2012 20:30:22 +0100 Subject: use format string defines since win32 doesn't like %qu --- src/common.h | 4 ++++ src/idevicerestore.c | 6 +++--- src/tss.c | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/common.h b/src/common.h index 1949a8c..938d14c 100644 --- a/src/common.h +++ b/src/common.h @@ -188,9 +188,13 @@ int write_file(const char* filename, const void* data, size_t size); char *generate_guid(); #ifdef WIN32 +#include #define __mkdir(path, mode) mkdir(path) +#define FMT_qu "%I64u" +#define sleep(x) Sleep(x*1000) #else #define __mkdir(path, mode) mkdir(path, mode) +#define FMT_qu "%qu" #endif extern struct idevicerestore_client_t* idevicerestore; diff --git a/src/idevicerestore.c b/src/idevicerestore.c index 5bf3283..72b2359 100644 --- a/src/idevicerestore.c +++ b/src/idevicerestore.c @@ -539,7 +539,7 @@ int main(int argc, char* argv[]) { error("ERROR: Unable to find device ECID\n"); return -1; } - info("Found ECID %llu\n", (long long unsigned int)client->ecid); + info("Found ECID " FMT_qu "\n", (long long unsigned int)client->ecid); if (get_shsh_blobs(client, client->ecid, NULL, 0, build_identity, &client->tss) < 0) { error("ERROR: Unable to get SHSH blobs for this device\n"); @@ -562,7 +562,7 @@ int main(int argc, char* argv[]) { plist_to_bin(client->tss, &bin, &blen); if (bin) { char zfn[512]; - sprintf(zfn, "shsh/%lld-%s-%s.shsh", (long long int)client->ecid, client->device->product, client->version); + sprintf(zfn, "shsh/" FMT_qu "-%s-%s.shsh", (long long int)client->ecid, client->device->product, client->version); __mkdir("shsh", 0755); struct stat fst; if (stat(zfn, &fst) != 0) { @@ -1044,7 +1044,7 @@ int get_shsh_blobs(struct idevicerestore_client_t* client, uint64_t ecid, unsign /* first check for local copy */ char zfn[512]; if (client->version) { - sprintf(zfn, "shsh/%lld-%s-%s.shsh", (long long int)client->ecid, client->device->product, client->version); + sprintf(zfn, "shsh/" FMT_qu "-%s-%s.shsh", (long long int)client->ecid, client->device->product, client->version); struct stat fst; if (stat(zfn, &fst) == 0) { gzFile zf = gzopen(zfn, "rb"); diff --git a/src/tss.c b/src/tss.c index 7a0b5cd..62c08b6 100644 --- a/src/tss.c +++ b/src/tss.c @@ -83,7 +83,7 @@ plist_t tss_create_request(plist_t build_identity, uint64_t ecid, unsigned char* error("ERROR: Unable to get ECID\n"); return NULL; } - snprintf(ecid_string, ECID_STRSIZE, "%qu", (long long unsigned int)ecid); + snprintf(ecid_string, ECID_STRSIZE, FMT_qu, (long long unsigned int)ecid); // Add build information to TSS request plist_t tss_request = plist_new_dict(); -- cgit v1.1-32-gdbae