diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/global/qglobal.h | 6 | ||||
-rw-r--r-- | src/corelib/io/qfilesystemengine_unix.cpp | 6 |
2 files changed, 3 insertions, 9 deletions
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index fc85bec962..62d5c4f037 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -1233,12 +1233,6 @@ inline int qIntCast(float f) { return int(f); } "Compile your code with -fPIC (and not with -fPIE)." #endif -namespace QtPrivate { -//like std::enable_if -template <bool B, typename T = void> struct QEnableIf; -template <typename T> struct QEnableIf<true, T> { typedef T Type; }; -} - #define QT_VA_ARGS_CHOOSE(_1, _2, _3, _4, _5, _6, _7, _8, _9, N, ...) N #define QT_VA_ARGS_EXPAND(...) __VA_ARGS__ // Needed for MSVC #define QT_VA_ARGS_COUNT(...) QT_VA_ARGS_EXPAND(QT_VA_ARGS_CHOOSE(__VA_ARGS__, 9, 8, 7, 6, 5, 4, 3, 2, 1)) diff --git a/src/corelib/io/qfilesystemengine_unix.cpp b/src/corelib/io/qfilesystemengine_unix.cpp index fb41b372a2..d97eec0229 100644 --- a/src/corelib/io/qfilesystemengine_unix.cpp +++ b/src/corelib/io/qfilesystemengine_unix.cpp @@ -194,7 +194,7 @@ namespace { namespace GetFileTimes { #if !QT_CONFIG(futimens) && (QT_CONFIG(futimes)) template <typename T> -static inline typename QtPrivate::QEnableIf<(&T::st_atim, &T::st_mtim, true)>::Type get(const T *p, struct timeval *access, struct timeval *modification) +static inline typename std::enable_if_t<(&T::st_atim, &T::st_mtim, true)> get(const T *p, struct timeval *access, struct timeval *modification) { access->tv_sec = p->st_atim.tv_sec; access->tv_usec = p->st_atim.tv_nsec / 1000; @@ -204,7 +204,7 @@ static inline typename QtPrivate::QEnableIf<(&T::st_atim, &T::st_mtim, true)>::T } template <typename T> -static inline typename QtPrivate::QEnableIf<(&T::st_atimespec, &T::st_mtimespec, true)>::Type get(const T *p, struct timeval *access, struct timeval *modification) +static inline typename std::enable_if_t<(&T::st_atimespec, &T::st_mtimespec, true)> get(const T *p, struct timeval *access, struct timeval *modification) { access->tv_sec = p->st_atimespec.tv_sec; access->tv_usec = p->st_atimespec.tv_nsec / 1000; @@ -216,7 +216,7 @@ static inline typename QtPrivate::QEnableIf<(&T::st_atimespec, &T::st_mtimespec, # ifndef st_atimensec // if "st_atimensec" is defined, this would expand to invalid C++ template <typename T> -static inline typename QtPrivate::QEnableIf<(&T::st_atimensec, &T::st_mtimensec, true)>::Type get(const T *p, struct timeval *access, struct timeval *modification) +static inline typename std::enable_if_t<(&T::st_atimensec, &T::st_mtimensec, true)> get(const T *p, struct timeval *access, struct timeval *modification) { access->tv_sec = p->st_atime; access->tv_usec = p->st_atimensec / 1000; |