From 2bc7dd6071205cb821235d4ef12b66bf2a4e5a0a Mon Sep 17 00:00:00 2001 From: tihmstar Date: Mon, 28 Nov 2016 11:23:13 +0100 Subject: [PATCH 1/2] stuff --- Makefile | 2 +- futurerestore/futurerestore.hpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 536eee71..b2d23a03 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ CXX = g++ CC = gcc INCLUDE += -I futurerestore -I /opt/local/include -I external/idevicerestore/src -I external/tsschecker/tsschecker -I external/img4tool/img4tool CFLAGS += $(INCLUDE) -Wall -std=c11 -D HAVE_CONFIG_H=1 -CXXFLAGS += $(INCLUDE) -Wall -std=c++11 +CXXFLAGS += $(INCLUDE) -Wall -std=c++11 -stdlib=libc++ LDFLAGS += -lirecovery -limobiledevice -lcrypto -lcurl -lplist -lc -lc++ -lzip -lpartialzip-1.0 -lz diff --git a/futurerestore/futurerestore.hpp b/futurerestore/futurerestore.hpp index 271a2f85..5d70c615 100644 --- a/futurerestore/futurerestore.hpp +++ b/futurerestore/futurerestore.hpp @@ -11,6 +11,7 @@ #include "config.h" #include +#include #include "idevicerestore.h" #include "jsmn.h" @@ -18,7 +19,7 @@ using namespace std; template class ptr_smart { - function _ptr_free = NULL; + std::function _ptr_free = NULL; public: T _p; ptr_smart(T p, function ptr_free){static_assert(is_pointer(), "error: this is for pointers only\n"); _p = p;_ptr_free = ptr_free;} From 818f5a3ea2815dee6695b1cc4f37c5d0b1a3bdb0 Mon Sep 17 00:00:00 2001 From: tihmstar Date: Mon, 28 Nov 2016 11:51:05 +0100 Subject: [PATCH 2/2] m --- Makefile | 2 +- futurerestore/futurerestore.cpp | 12 ++++++++++-- futurerestore/main.cpp | 1 + 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index b2d23a03..9149a9be 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ CXX = g++ CC = gcc INCLUDE += -I futurerestore -I /opt/local/include -I external/idevicerestore/src -I external/tsschecker/tsschecker -I external/img4tool/img4tool CFLAGS += $(INCLUDE) -Wall -std=c11 -D HAVE_CONFIG_H=1 -CXXFLAGS += $(INCLUDE) -Wall -std=c++11 -stdlib=libc++ +CXXFLAGS += $(INCLUDE) -Wall -std=c++11 LDFLAGS += -lirecovery -limobiledevice -lcrypto -lcurl -lplist -lc -lc++ -lzip -lpartialzip-1.0 -lz diff --git a/futurerestore/futurerestore.cpp b/futurerestore/futurerestore.cpp index 7c978a21..e16203d2 100644 --- a/futurerestore/futurerestore.cpp +++ b/futurerestore/futurerestore.cpp @@ -23,6 +23,14 @@ #include "restore.h" #include "tsschecker.h" +#ifdef WIN32 +#include +#define __mkdir(path, mode) mkdir(path) +#else +#include +#define __mkdir(path, mode) mkdir(path, mode) +#endif + #define NONCESIZE 20 #define USEC_PER_SEC 1000000 @@ -44,7 +52,7 @@ futurerestore::futurerestore(){ if (_client == NULL) throw std::string("could not create idevicerestore client\n"); struct stat st{0}; - if (stat(FUTURERESTORE_TMP_PATH, &st) == -1) mkdir(FUTURERESTORE_TMP_PATH, 0755); + if (stat(FUTURERESTORE_TMP_PATH, &st) == -1) __mkdir(FUTURERESTORE_TMP_PATH, 0755); //tsschecker nocache nocache = 1; @@ -658,7 +666,7 @@ char *futurerestore::getPathOfElementInManifest(const char *element, const char char *pathStr = NULL; ptr_smart buildmanifest(NULL,plist_free); - plist_from_xml(manifeststr, (uint)strlen(manifeststr), &buildmanifest); + plist_from_xml(manifeststr, (uint32_t)strlen(manifeststr), &buildmanifest); if (plist_t buildidentities = plist_dict_get_item(buildmanifest._p, "BuildIdentities")) if (plist_t firstIdentitie = plist_array_get_item(buildidentities, 0)) diff --git a/futurerestore/main.cpp b/futurerestore/main.cpp index b7d8e326..b16ebe74 100644 --- a/futurerestore/main.cpp +++ b/futurerestore/main.cpp @@ -8,6 +8,7 @@ #include #include +#include #include "futurerestore.hpp" #include "all_tsschecker.h" #include "tsschecker.h"