siphash.h: Address lack of stdint.h for Visual Studio 2003-2008

This commit is contained in:
Sebastian Pipping 2017-06-18 22:03:01 +02:00
parent 1ce8ec1c12
commit c74d380b8f
2 changed files with 14 additions and 1 deletions

View File

@ -6,8 +6,10 @@ Release 2.??? ????????????????
Other changes:
#49 Fix "==" Bashism in configure script
#50 Fix too eager getrandom detection for Debian GNU/kFreeBSD
#51 Address lack of stdint.h in Visual Studio 2003 to 2008
Special thanks to:
Cătălin Răceanu
László Böszörményi
S. P. Zeidler

View File

@ -12,6 +12,9 @@
* --------------------------------------------------------------------------
* HISTORY:
*
* 2017-06-18 (Sebastian Pipping)
* - Address lack of stdint.h for Visual Studio 2003 to 2008
*
* 2017-06-10 (Sebastian Pipping)
* - Clarify license note in the header
* - Address C89 issues:
@ -76,7 +79,15 @@
#define SIPHASH_H
#include <stddef.h> /* size_t */
#if defined(_WIN32) && defined(_MSC_VER) && (_MSC_VER < 1600)
/* For vs2003/7.1 up to vs2008/9.0; _MSC_VER 1600 is vs2010/10.0 */
typedef unsigned __int8 uint8_t;
typedef unsigned __int32 uint32_t;
typedef unsigned __int64 uint64_t;
#else
#include <stdint.h> /* uint64_t uint32_t uint8_t */
#endif
#define SIP_ROTL(x, b) (uint64_t)(((x) << (b)) | ( (x) >> (64 - (b))))