From f885a526acbb2d5fd15fe76478bf3faef1570aec Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Wed, 29 Feb 2012 01:01:01 +0100 Subject: SHA-2 code does not compile on FreeBSD The code fails to compile with the below error: qcryptographichash.cpp:55: error: conflicting declaration 'typedef quint64 uint64_t' /usr/include/sys/types.h:99: error: 'uint64_t' has a previous declaration as 'typedef __uint64_t uint64_t' FreeBSDs types.h defines the used defines. Maybe it would be less ugly to switch the code to quint*, or use a define to do so, or to have basic os detection for stdint.h, not to include sys/types.h. Change-Id: Ic62ae4b742c1123b4b7e17158d216374e609f59f Reviewed-by: Bradley T. Hughes --- src/corelib/tools/qcryptographichash.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/corelib/tools/qcryptographichash.cpp') diff --git a/src/corelib/tools/qcryptographichash.cpp b/src/corelib/tools/qcryptographichash.cpp index 31a0fdc5e6..3730a6c580 100644 --- a/src/corelib/tools/qcryptographichash.cpp +++ b/src/corelib/tools/qcryptographichash.cpp @@ -52,9 +52,18 @@ from from stdint.h, but since this header is not available on all platforms (MSVC 2008, for example), we need to define them ourselves. */ +#ifndef _UINT64_T_DECLARED typedef QT_PREPEND_NAMESPACE(quint64) uint64_t; +#endif + +#ifndef _UINT32_T_DECLARED typedef QT_PREPEND_NAMESPACE(quint32) uint32_t; +#endif + +#ifndef _UINT8_T_DECLARED typedef QT_PREPEND_NAMESPACE(quint8) uint8_t; +#endif + typedef QT_PREPEND_NAMESPACE(qint16) int_least16_t; // Header from rfc6234 with 1 modification: // sha1.h - commented out '#include ' on line 74 -- cgit v1.2.3