fix issues on different MinGW distro
This commit is contained in:
parent
57fe04119f
commit
bd5e9fdc4a
@ -36,7 +36,7 @@
|
|||||||
* - STD_TO_STRING_NOT_SUPPORTED (MinGW with GCC < 4.8)
|
* - STD_TO_STRING_NOT_SUPPORTED (MinGW with GCC < 4.8)
|
||||||
* - STD_FILESYSTEM_NOT_SUPPORTED (GCC < 5.3) ....
|
* - STD_FILESYSTEM_NOT_SUPPORTED (GCC < 5.3) ....
|
||||||
* - CXX_NO_INLINE_NAMESPACE (Visual C++ < 2015)
|
* - CXX_NO_INLINE_NAMESPACE (Visual C++ < 2015)
|
||||||
* - _enable_std_make_unique (GCC < 4.9)
|
* - _enable_std_make_unique (__cpluscplus < 201402)
|
||||||
* - _enable_std_put_time (GCC < 5)
|
* - _enable_std_put_time (GCC < 5)
|
||||||
* - _enable_std_clamp (Visual C++ < 2017)
|
* - _enable_std_clamp (Visual C++ < 2017)
|
||||||
*/
|
*/
|
||||||
@ -118,13 +118,6 @@
|
|||||||
#if defined(__GLIBCPP__) || defined(__GLIBCXX__)
|
#if defined(__GLIBCPP__) || defined(__GLIBCXX__)
|
||||||
//<codecvt> is a known issue on libstdc++, it works on libc++
|
//<codecvt> is a known issue on libstdc++, it works on libc++
|
||||||
#define STD_CODECVT_NOT_SUPPORTED
|
#define STD_CODECVT_NOT_SUPPORTED
|
||||||
|
|
||||||
#if !defined(__cpp_lib_make_unique) || (__cpp_lib_make_unique != 201304)
|
|
||||||
#ifndef _enable_std_make_unique
|
|
||||||
#define _enable_std_make_unique
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
#elif defined(__GNUC__) //GCC
|
#elif defined(__GNUC__) //GCC
|
||||||
|
|
||||||
@ -149,20 +142,19 @@
|
|||||||
# define _enable_std_put_time
|
# define _enable_std_put_time
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
#if ((__GNUC__ > 5) || ((__GNUC__ == 5) && (__GNUC_MINOR__ >= 3 ) ) )
|
# if ((__GNUC__ > 5) || ((__GNUC__ == 5) && (__GNUC_MINOR__ >= 3 ) ) )
|
||||||
# undef STD_FILESYSTEM_NOT_SUPPORTED
|
# undef STD_FILESYSTEM_NOT_SUPPORTED
|
||||||
/// \todo define the namespace ????
|
# endif
|
||||||
#endif
|
|
||||||
|
|
||||||
#if (__GNUC__ == 4)
|
#if (__GNUC__ == 4)
|
||||||
#if ((__GNUC_MINOR__ < 8) || (__GNUC_MINOR__ == 8 && __GNUC_PATCHLEVEL__ < 1))
|
#if ((__GNUC_MINOR__ < 8) || (__GNUC_MINOR__ == 8 && __GNUC_PATCHLEVEL__ < 1))
|
||||||
#define STD_THREAD_NOT_SUPPORTED
|
#define STD_THREAD_NOT_SUPPORTED
|
||||||
#endif
|
#endif
|
||||||
|
#if 0
|
||||||
#if (__GNUC_MINOR__ < 9)
|
#if (__GNUC_MINOR__ < 9)
|
||||||
#define _enable_std_make_unique
|
#define _enable_std_make_unique
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
#if defined(NANA_MINGW)
|
#if defined(NANA_MINGW)
|
||||||
#ifndef __MINGW64_VERSION_MAJOR
|
#ifndef __MINGW64_VERSION_MAJOR
|
||||||
//It's a knonwn issue under MinGW(except MinGW-W64)
|
//It's a knonwn issue under MinGW(except MinGW-W64)
|
||||||
@ -191,8 +183,18 @@
|
|||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//Detects the feature std::clamp
|
#include <iosfwd>
|
||||||
|
|
||||||
|
//Detects std::make_unique
|
||||||
|
#if (!defined(_MSC_VER)) && (__cplusplus < 201402L)
|
||||||
|
# if !defined(__cpp_lib_make_unique) || (__cpp_lib_make_unique != 201304)
|
||||||
|
# ifndef _enable_std_make_unique
|
||||||
|
# define _enable_std_make_unique
|
||||||
|
# endif
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
//Detects the feature std::clamp
|
||||||
//Visual C++ 2017 with /std:c++latest provides the std::clamp
|
//Visual C++ 2017 with /std:c++latest provides the std::clamp
|
||||||
#if !defined(_MSVC_LANG) || (_MSVC_LANG < 201403L)
|
#if !defined(_MSVC_LANG) || (_MSVC_LANG < 201403L)
|
||||||
|
|
||||||
|
@ -65,14 +65,14 @@ namespace std {
|
|||||||
} // std
|
} // std
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
# undef NANA_USING_STD_FILESYSTEM
|
||||||
#undef NANA_USING_STD_FILESYSTEM
|
# define NANA_USING_STD_FILESYSTEM 1
|
||||||
#define NANA_USING_STD_FILESYSTEM 1
|
|
||||||
# include <experimental/filesystem>
|
# include <experimental/filesystem>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#ifndef __cpp_lib_experimental_filesystem
|
#ifndef __cpp_lib_experimental_filesystem
|
||||||
# define __cpp_lib_experimental_filesystem 1
|
# define __cpp_lib_experimental_filesystem 201406
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if NANA_USING_NANA_FILESYSTEM
|
#if NANA_USING_NANA_FILESYSTEM
|
||||||
|
@ -3,6 +3,11 @@
|
|||||||
#include "../paint/truetype.hpp"
|
#include "../paint/truetype.hpp"
|
||||||
|
|
||||||
#ifdef NANA_WINDOWS
|
#ifdef NANA_WINDOWS
|
||||||
|
|
||||||
|
# ifndef _WIN32_WINNT
|
||||||
|
# define _WIN32_WINNT 0x0501
|
||||||
|
# endif
|
||||||
|
|
||||||
# include <windows.h>
|
# include <windows.h>
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
@ -50,6 +55,19 @@ IsWindowsVersionOrGreater(WORD wMajorVersion, WORD wMinorVersion, WORD wServiceP
|
|||||||
return VerifyVersionInfoW(&osvi, VER_MAJORVERSION | VER_MINORVERSION | VER_SERVICEPACKMAJOR, dwlConditionMask) != FALSE;
|
return VerifyVersionInfoW(&osvi, VER_MAJORVERSION | VER_MINORVERSION | VER_SERVICEPACKMAJOR, dwlConditionMask) != FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef _WIN32_WINNT_WINXP
|
||||||
|
# define _WIN32_WINNT_WINXP 0x0501
|
||||||
|
#endif // _WIN32_WINNT_WINXP
|
||||||
|
|
||||||
|
#ifndef _WIN32_WINNT_VISTA
|
||||||
|
# define _WIN32_WINNT_VISTA 0x0600
|
||||||
|
#endif // _WIN32_WINNT_VISTA
|
||||||
|
|
||||||
|
#ifndef _WIN32_WINNT_WIN7
|
||||||
|
# define _WIN32_WINNT_WIN7 0x0601
|
||||||
|
#endif // _WIN32_WINNT_WIN7
|
||||||
|
|
||||||
|
|
||||||
VERSIONHELPERAPI
|
VERSIONHELPERAPI
|
||||||
IsWindowsXPOrGreater()
|
IsWindowsXPOrGreater()
|
||||||
{
|
{
|
||||||
@ -119,20 +137,6 @@ IsWindows8OrGreater()
|
|||||||
#define _WIN32_WINNT_WINBLUE (0x0602)
|
#define _WIN32_WINNT_WINBLUE (0x0602)
|
||||||
#endif // _WIN32_WINNT_WINBLUE (0x0602)
|
#endif // _WIN32_WINNT_WINBLUE (0x0602)
|
||||||
|
|
||||||
VERSIONHELPERAPI
|
|
||||||
IsWindows8Point1OrGreater()
|
|
||||||
{
|
|
||||||
return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WINBLUE), LOBYTE(_WIN32_WINNT_WINBLUE), 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
VERSIONHELPERAPI
|
|
||||||
IsWindowsServer()
|
|
||||||
{
|
|
||||||
OSVERSIONINFOEXW osvi = { sizeof(osvi), 0, 0, 0, 0, { 0 }, 0, 0, 0, VER_NT_WORKSTATION };
|
|
||||||
DWORDLONG const dwlConditionMask = VerSetConditionMask(0, VER_PRODUCT_TYPE, VER_EQUAL);
|
|
||||||
|
|
||||||
return !VerifyVersionInfoW(&osvi, VER_PRODUCT_TYPE, dwlConditionMask);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // NTDDI_VERSION
|
#endif // NTDDI_VERSION
|
||||||
|
|
||||||
|
@ -24,170 +24,6 @@
|
|||||||
#include <shellapi.h>
|
#include <shellapi.h>
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
/******************************************************************
|
|
||||||
* *
|
|
||||||
* VersionHelpers.h -- This module defines helper functions to *
|
|
||||||
* promote version check with proper *
|
|
||||||
* comparisons. *
|
|
||||||
* *
|
|
||||||
* Copyright (c) Microsoft Corp. All rights reserved. *
|
|
||||||
* *
|
|
||||||
******************************************************************/
|
|
||||||
|
|
||||||
#include <specstrings.h> // for _In_, etc.
|
|
||||||
|
|
||||||
#if !defined(__midl) && !defined(SORTPP_PASS)
|
|
||||||
|
|
||||||
#if (NTDDI_VERSION >= NTDDI_WINXP)
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
|
|
||||||
#define VERSIONHELPERAPI inline bool
|
|
||||||
|
|
||||||
#else // __cplusplus
|
|
||||||
|
|
||||||
#define VERSIONHELPERAPI FORCEINLINE BOOL
|
|
||||||
|
|
||||||
#endif // __cplusplus
|
|
||||||
|
|
||||||
VERSIONHELPERAPI
|
|
||||||
IsWindowsVersionOrGreater(WORD wMajorVersion, WORD wMinorVersion, WORD wServicePackMajor)
|
|
||||||
{
|
|
||||||
OSVERSIONINFOEXW osvi = { sizeof(osvi), 0, 0, 0, 0,{ 0 }, 0, 0 };
|
|
||||||
DWORDLONG const dwlConditionMask = VerSetConditionMask(
|
|
||||||
VerSetConditionMask(
|
|
||||||
VerSetConditionMask(
|
|
||||||
0, VER_MAJORVERSION, VER_GREATER_EQUAL),
|
|
||||||
VER_MINORVERSION, VER_GREATER_EQUAL),
|
|
||||||
VER_SERVICEPACKMAJOR, VER_GREATER_EQUAL);
|
|
||||||
|
|
||||||
osvi.dwMajorVersion = wMajorVersion;
|
|
||||||
osvi.dwMinorVersion = wMinorVersion;
|
|
||||||
osvi.wServicePackMajor = wServicePackMajor;
|
|
||||||
|
|
||||||
return VerifyVersionInfoW(&osvi, VER_MAJORVERSION | VER_MINORVERSION | VER_SERVICEPACKMAJOR, dwlConditionMask) != FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
VERSIONHELPERAPI
|
|
||||||
IsWindowsXPOrGreater()
|
|
||||||
{
|
|
||||||
return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WINXP), LOBYTE(_WIN32_WINNT_WINXP), 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
VERSIONHELPERAPI
|
|
||||||
IsWindowsXPSP1OrGreater()
|
|
||||||
{
|
|
||||||
return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WINXP), LOBYTE(_WIN32_WINNT_WINXP), 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
VERSIONHELPERAPI
|
|
||||||
IsWindowsXPSP2OrGreater()
|
|
||||||
{
|
|
||||||
return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WINXP), LOBYTE(_WIN32_WINNT_WINXP), 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
VERSIONHELPERAPI
|
|
||||||
IsWindowsXPSP3OrGreater()
|
|
||||||
{
|
|
||||||
return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WINXP), LOBYTE(_WIN32_WINNT_WINXP), 3);
|
|
||||||
}
|
|
||||||
|
|
||||||
VERSIONHELPERAPI
|
|
||||||
IsWindowsVistaOrGreater()
|
|
||||||
{
|
|
||||||
return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_VISTA), LOBYTE(_WIN32_WINNT_VISTA), 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
VERSIONHELPERAPI
|
|
||||||
IsWindowsVistaSP1OrGreater()
|
|
||||||
{
|
|
||||||
return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_VISTA), LOBYTE(_WIN32_WINNT_VISTA), 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
VERSIONHELPERAPI
|
|
||||||
IsWindowsVistaSP2OrGreater()
|
|
||||||
{
|
|
||||||
return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_VISTA), LOBYTE(_WIN32_WINNT_VISTA), 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
VERSIONHELPERAPI
|
|
||||||
IsWindows7OrGreater()
|
|
||||||
{
|
|
||||||
return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WIN7), LOBYTE(_WIN32_WINNT_WIN7), 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
VERSIONHELPERAPI
|
|
||||||
IsWindows7SP1OrGreater()
|
|
||||||
{
|
|
||||||
return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WIN7), LOBYTE(_WIN32_WINNT_WIN7), 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifndef _WIN32_WINNT_WIN8 // (0x0602)
|
|
||||||
#define _WIN32_WINNT_WIN8 (0x0602)
|
|
||||||
#endif // _WIN32_WINNT_WIN8(0x0602)
|
|
||||||
|
|
||||||
VERSIONHELPERAPI
|
|
||||||
IsWindows8OrGreater()
|
|
||||||
{
|
|
||||||
|
|
||||||
return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WIN8), LOBYTE(_WIN32_WINNT_WIN8), 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifndef _WIN32_WINNT_WINBLUE // (0x0602)
|
|
||||||
#define _WIN32_WINNT_WINBLUE (0x0602)
|
|
||||||
#endif // _WIN32_WINNT_WINBLUE (0x0602)
|
|
||||||
|
|
||||||
VERSIONHELPERAPI
|
|
||||||
IsWindows8Point1OrGreater()
|
|
||||||
{
|
|
||||||
return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WINBLUE), LOBYTE(_WIN32_WINNT_WINBLUE), 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
VERSIONHELPERAPI
|
|
||||||
IsWindowsServer()
|
|
||||||
{
|
|
||||||
OSVERSIONINFOEXW osvi = { sizeof(osvi), 0, 0, 0, 0,{ 0 }, 0, 0, 0, VER_NT_WORKSTATION };
|
|
||||||
DWORDLONG const dwlConditionMask = VerSetConditionMask(0, VER_PRODUCT_TYPE, VER_EQUAL);
|
|
||||||
|
|
||||||
return !VerifyVersionInfoW(&osvi, VER_PRODUCT_TYPE, dwlConditionMask);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // NTDDI_VERSION
|
|
||||||
|
|
||||||
#endif // defined(__midl)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//#if defined(_MSC_VER)
|
|
||||||
////#include <VersionHelpers.h>
|
|
||||||
//bool IsWindowsVistaOrGreater() { return false; }
|
|
||||||
//bool //VERSIONHELPERAPI
|
|
||||||
//IsWindowsVersionOrGreater(WORD wMajorVersion, WORD wMinorVersion, WORD wServicePackMajor)
|
|
||||||
//{
|
|
||||||
// OSVERSIONINFOEXW osvi = { sizeof(osvi), 0, 0, 0, 0,{ 0 }, 0, 0 };
|
|
||||||
// DWORDLONG const dwlConditionMask = VerSetConditionMask(
|
|
||||||
// VerSetConditionMask(
|
|
||||||
// VerSetConditionMask(
|
|
||||||
// 0, VER_MAJORVERSION, VER_GREATER_EQUAL),
|
|
||||||
// VER_MINORVERSION, VER_GREATER_EQUAL),
|
|
||||||
// VER_SERVICEPACKMAJOR, VER_GREATER_EQUAL);
|
|
||||||
//
|
|
||||||
// osvi.dwMajorVersion = wMajorVersion;
|
|
||||||
// osvi.dwMinorVersion = wMinorVersion;
|
|
||||||
// osvi.wServicePackMajor = wServicePackMajor;
|
|
||||||
//
|
|
||||||
// return VerifyVersionInfoW(&osvi, VER_MAJORVERSION | VER_MINORVERSION | VER_SERVICEPACKMAJOR, dwlConditionMask) != FALSE;
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//#endif // _MSVC
|
|
||||||
|
|
||||||
namespace nana
|
namespace nana
|
||||||
{
|
{
|
||||||
|
@ -100,7 +100,7 @@ namespace nana
|
|||||||
tmp.swap(displays);
|
tmp.swap(displays);
|
||||||
}
|
}
|
||||||
|
|
||||||
static BOOL __stdcall enum_proc(HMONITOR handle, HDC context, LPRECT r, LPARAM self_ptr)
|
static BOOL __stdcall enum_proc(HMONITOR handle, HDC /*context*/, LPRECT /*r*/, LPARAM self_ptr)
|
||||||
{
|
{
|
||||||
auto disp_cont = reinterpret_cast<std::vector<real_display>*>(self_ptr);
|
auto disp_cont = reinterpret_cast<std::vector<real_display>*>(self_ptr);
|
||||||
MONITORINFOEX mi;
|
MONITORINFOEX mi;
|
||||||
|
@ -142,7 +142,7 @@ namespace nana
|
|||||||
}; //end class timer_core
|
}; //end class timer_core
|
||||||
|
|
||||||
#if defined(NANA_WINDOWS)
|
#if defined(NANA_WINDOWS)
|
||||||
void __stdcall timer_driver::_m_timer_proc(HWND hwnd, UINT uMsg, UINT_PTR id, DWORD dwTime)
|
void __stdcall timer_driver::_m_timer_proc(HWND /*hwnd*/, UINT /*uMsg*/, UINT_PTR id, DWORD /*dwTime*/)
|
||||||
#else
|
#else
|
||||||
void timer_driver::_m_timer_proc(std::size_t id)
|
void timer_driver::_m_timer_proc(std::size_t id)
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user