summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2012-02-12 20:30:22 +0100
committerGravatar Nikias Bassen2012-02-12 20:30:22 +0100
commit23abb2405f3401690fef892425afbb364bef3b93 (patch)
tree6466d3921a15194e8d1dea242063d4d161f8bc42 /src
parent8072f14f4706a4d3b46e8a88cfbcfdd205435868 (diff)
downloadidevicerestore-23abb2405f3401690fef892425afbb364bef3b93.tar.gz
idevicerestore-23abb2405f3401690fef892425afbb364bef3b93.tar.bz2
use format string defines since win32 doesn't like %qu
Diffstat (limited to 'src')
-rw-r--r--src/common.h4
-rw-r--r--src/idevicerestore.c6
-rw-r--r--src/tss.c2
3 files changed, 8 insertions, 4 deletions
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 <windows.h>
#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();