Compile fix: undefine types before defining them

On NetBSD, the types uint64_t, uint32_t and uint8_t
are already defined in sys/types.h which leads to compile errors.
Those types need to be properly undefined before defining
them with the Qt code.

Change-Id: Icd58f421619f15b899cf5c5de1cfb22a519a4e4b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Ralf Nolden 2016-05-22 13:31:27 +02:00
parent e91be71ef0
commit 14ae00dd50
2 changed files with 40 additions and 0 deletions

View File

@ -89,9 +89,29 @@ static SHA3Final * const sha3Final = Final;
available on all platforms (MSVC 2008, for example), we #define them to the
Qt equivalents.
*/
#ifdef uint64_t
#undef uint64_t
#endif
#define uint64_t QT_PREPEND_NAMESPACE(quint64)
#ifdef uint32_t
#undef uint32_t
#endif
#define uint32_t QT_PREPEND_NAMESPACE(quint32)
#ifdef uint8_t
#undef uint8_t
#endif
#define uint8_t QT_PREPEND_NAMESPACE(quint8)
#ifdef int_least16_t
#undef int_least16_t
#endif
#define int_least16_t QT_PREPEND_NAMESPACE(qint16)
// Header from rfc6234 with 1 modification:

View File

@ -40,9 +40,29 @@
available on all platforms (MSVC 2008, for example), we #define them to the
Qt equivalents.
*/
#ifdef uint64_t
#undef uint64_t
#endif
#define uint64_t QT_PREPEND_NAMESPACE(quint64)
#ifdef uint32_t
#undef uint32_t
#endif
#define uint32_t QT_PREPEND_NAMESPACE(quint32)
#ifdef uint8_t
#undef uint8_t
#endif
#define uint8_t QT_PREPEND_NAMESPACE(quint8)
#ifdef int_least16_t
#undef int_least16_t
#endif
#define int_least16_t QT_PREPEND_NAMESPACE(qint16)
// Header from rfc6234 with 1 modification: