From 3c51eafaf49f03d0250525b58932e07a8c815277 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Fri, 18 Nov 2022 11:39:51 +0100 Subject: [PATCH] Add missing headerh will be needed on Ubuntu - closes https://github.com/assimp/assimp/issues/4720 --- include/assimp/Hash.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/include/assimp/Hash.h b/include/assimp/Hash.h index 18bd270f5..188e98a94 100644 --- a/include/assimp/Hash.h +++ b/include/assimp/Hash.h @@ -47,6 +47,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endif #include +#include #include #include @@ -64,11 +65,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #undef get16bits #if (defined(__GNUC__) && defined(__i386__)) || defined(__WATCOMC__) \ || defined(_MSC_VER) || defined (__BORLANDC__) || defined (__TURBOC__) -#define get16bits(d) (*((const uint16_t *) (d))) +# define get16bits(d) (*((const uint16_t *) (d))) #endif #if !defined (get16bits) -#define get16bits(d) ((((uint32_t)(((const uint8_t *)(d))[1])) << 8)\ +# define get16bits(d) ((((uint32_t)(((const uint8_t *)(d))[1])) << 8)\ +(uint32_t)(((const uint8_t *)(d))[0]) ) #endif @@ -77,8 +78,8 @@ inline uint32_t SuperFastHash (const char * data, uint32_t len = 0, uint32_t has uint32_t tmp; int rem; - if (!data) return 0; - if (!len)len = (uint32_t)::strlen(data); + if (data == NULL) return 0; + if (len == 0)len = (uint32_t)::strlen(data); rem = len & 3; len >>= 2;