diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-03-14 17:09:53 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-03-14 17:09:53 +0300 |
commit | 1a5e7c2f37f1f3b9969c01e61ab9347dcd546bee (patch) | |
tree | bf0285e1c321689e2a6b6d015099d2edcb0c3d1f | |
parent | 6045a08795de838f8f05ed86b8579288c4d8cbaf (diff) | |
download | manaverse-1a5e7c2f37f1f3b9969c01e61ab9347dcd546bee.tar.gz manaverse-1a5e7c2f37f1f3b9969c01e61ab9347dcd546bee.tar.bz2 manaverse-1a5e7c2f37f1f3b9969c01e61ab9347dcd546bee.tar.xz manaverse-1a5e7c2f37f1f3b9969c01e61ab9347dcd546bee.zip |
Fix compilation for windows 64 with mingw.
-rw-r--r-- | src/gui/windowmanager.cpp | 6 | ||||
-rw-r--r-- | src/localconsts.h | 4 | ||||
-rw-r--r-- | src/utils/process.cpp | 11 | ||||
-rw-r--r-- | src/utils/stringutils.cpp | 6 | ||||
-rw-r--r-- | src/utils/stringutils.h | 6 |
5 files changed, 25 insertions, 8 deletions
diff --git a/src/gui/windowmanager.cpp b/src/gui/windowmanager.cpp index e578a21c9..7d6f6ff6c 100644 --- a/src/gui/windowmanager.cpp +++ b/src/gui/windowmanager.cpp @@ -386,7 +386,13 @@ void WindowManager::setIcon() icon = LoadIcon(GetModuleHandle(nullptr), "A"); } if (icon) + { +#ifdef WIN64 + SetClassLongPtr(pInfo.window, GCLP_HICON, reinterpret_cast<LONG_PTR>(icon)); +#else // WIN64 SetClassLong(pInfo.window, GCL_HICON, reinterpret_cast<LONG>(icon)); +#endif // WIN64 + } #else // WIN32 mIcon = MIMG_Load(iconFile.c_str()); diff --git a/src/localconsts.h b/src/localconsts.h index 08b64e0d9..786177138 100644 --- a/src/localconsts.h +++ b/src/localconsts.h @@ -140,11 +140,15 @@ #ifdef __x86_64__ #if !defined(__clang__) && defined(__GNUC__) +// not for FreeBSD #if !defined(__FreeBSD_kernel__) || !defined(__GLIBC__) +// not works in mingw +#ifndef WIN64 // gcc 4.8 look like support avx2, but need global define for enable any SIMD #if GCC_VERSION >= 40900 #define SIMD_SUPPORTED #endif // GCC_VERSION > 40900 +#endif // WIN64 #endif // !defined(__FreeBSD_kernel__) || !defined(__GLIBC__) #endif // !defined(__clang__) && defined(__GNUC__) #endif // __x86_64__ diff --git a/src/utils/process.cpp b/src/utils/process.cpp index 7aa1aa619..f84506024 100644 --- a/src/utils/process.cpp +++ b/src/utils/process.cpp @@ -241,10 +241,17 @@ bool execFile(const std::string &pathName A_UNUSED, #endif // WIN32 -#ifdef WIN32 +#if defined WIN64 +bool openBrowser(std::string url) +{ + return reinterpret_cast<int64_t>(ShellExecute(nullptr, "open", + replaceAll(url, " ", "").c_str(), + nullptr, nullptr, SW_SHOWNORMAL)) > 32; +} +#elif defined WIN32 bool openBrowser(std::string url) { - return reinterpret_cast<int>(ShellExecute(nullptr, "open", + return reinterpret_cast<int32_t>(ShellExecute(nullptr, "open", replaceAll(url, " ", "").c_str(), nullptr, nullptr, SW_SHOWNORMAL)) > 32; } diff --git a/src/utils/stringutils.cpp b/src/utils/stringutils.cpp index 3663cc007..5a343cdbd 100644 --- a/src/utils/stringutils.cpp +++ b/src/utils/stringutils.cpp @@ -791,7 +791,7 @@ std::string toStringPrint(const unsigned int val) return str; } -std::string toString(unsigned int num) +std::string toString(uint32_t num) { char buf[30]; buf[29] = '\0'; @@ -802,7 +802,7 @@ std::string toString(unsigned int num) return buf + idx + 1; } -std::string toString(unsigned long num) +std::string toString(uint64_t num) { char buf[100]; buf[99] = '\0'; @@ -835,7 +835,7 @@ std::string toString(unsigned char num) return buf + idx + 1; } -std::string toString(int num) +std::string toString(int32_t num) { char buf[30]; bool useSign(false); diff --git a/src/utils/stringutils.h b/src/utils/stringutils.h index 6c2b6f097..02113d4c2 100644 --- a/src/utils/stringutils.h +++ b/src/utils/stringutils.h @@ -69,13 +69,13 @@ unsigned int atox(const std::string &str) A_WARN_UNUSED; * @param num the value to convert to a string * @return the string representation of arg */ -std::string toString(unsigned int num); +std::string toString(uint32_t num); -std::string toString(unsigned long num); +std::string toString(uint64_t num); std::string toString(unsigned char num); -std::string toString(int num); +std::string toString(int32_t num); std::string toString(uint16_t num); |