Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sha2/sha2.c: fix build on big endian
Build is broken since 865ec9b because tmp is undefined in put32be and put64be: /home/buildroot/autobuild/instance-1/output-1/host/bin/m68k-linux-gcc -DSHA2_USE_INTTYPES_H -Wall -std=c99 -pedantic -fPIC -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -DDTLSv12 -DWITH_SHA256 -I.. -c -o sha2.o sha2.c sha2.c: In function 'get32be': sha2.c:164:2: warning: implicit declaration of function 'MEMCPY_BCOPY' [-Wimplicit-function-declaration] MEMCPY_BCOPY(&tmp, data, sizeof(tmp)); ^~~~~~~~~~~~ sha2.c: In function 'put32be': sha2.c:177:34: error: 'tmp' undeclared (first use in this function) MEMCPY_BCOPY(data, &val, sizeof(tmp)); ^~~ Fix this error by replacing tmp by val Moreover, move MEMCPY_BCOPY before its usage or linking step will fail Fixes: - http://autobuild.buildroot.org/results/e8704e02fdede7b63e22da552292977b23380b32 Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
- Loading branch information