summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/sha3
diff options
context:
space:
mode:
authorJan Arve Saether <jan-arve.saether@digia.com>2013-11-13 08:49:44 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-11-15 09:14:40 +0100
commit191f96cb8817a6d1632331c67f4f8d45535205e1 (patch)
tree5c3729fedefb29b20e05c4c8bdaaca24f73b8ed0 /src/3rdparty/sha3
parentf75c5c7dc64ae6248f8fbbabb434f871c0867d59 (diff)
Avoid compiler warning about alignment for MSVC2013 (x64)
Only align if we actually *need to* (due to SSE/XOP usage) The code will currently not compile as it is now with UseSSE or UseXOP defined, (so the ALIGN macro could just be totally removed). In order to keep the diff to upstream as small as possible, we keep the ALIGN macro definition. Task-number: QTBUG-34362 Change-Id: I6cf420205896e3a476cdcfbf3308a07e0ae0c84e Reviewed-by: Richard J. Moore <rich@kde.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/3rdparty/sha3')
-rwxr-xr-xsrc/3rdparty/sha3/KeccakF-1600-opt64.c8
-rwxr-xr-xsrc/3rdparty/sha3/KeccakSponge.h8
2 files changed, 12 insertions, 4 deletions
diff --git a/src/3rdparty/sha3/KeccakF-1600-opt64.c b/src/3rdparty/sha3/KeccakF-1600-opt64.c
index 0432f1ab18..7bd442ef69 100755
--- a/src/3rdparty/sha3/KeccakF-1600-opt64.c
+++ b/src/3rdparty/sha3/KeccakF-1600-opt64.c
@@ -19,12 +19,16 @@ http://creativecommons.org/publicdomain/zero/1.0/
typedef unsigned char UINT8;
typedef unsigned long long int UINT64;
+#if defined(UseSSE) || defined(UseXOP)
#if defined(__GNUC__)
#define ALIGN __attribute__ ((aligned(32)))
#elif defined(_MSC_VER)
#define ALIGN __declspec(align(32))
-#else
-#define ALIGN
+#endif
+#endif
+
+#ifndef ALIGN
+# define ALIGN
#endif
#if defined(UseSSE)
diff --git a/src/3rdparty/sha3/KeccakSponge.h b/src/3rdparty/sha3/KeccakSponge.h
index a545cacb30..8bb11a8a1d 100755
--- a/src/3rdparty/sha3/KeccakSponge.h
+++ b/src/3rdparty/sha3/KeccakSponge.h
@@ -19,12 +19,16 @@ http://creativecommons.org/publicdomain/zero/1.0/
#define KeccakMaximumRate 1536
#define KeccakMaximumRateInBytes (KeccakMaximumRate/8)
+#if defined(UseSSE) || defined(UseXOP)
#if defined(__GNUC__)
#define ALIGN __attribute__ ((aligned(32)))
#elif defined(_MSC_VER)
#define ALIGN __declspec(align(32))
-#else
-#define ALIGN
+#endif
+#endif
+
+#ifndef ALIGN
+# define ALIGN
#endif
ALIGN typedef struct spongeStateStruct {