From 785a438ddd32e7645628fe20b96112be330ddcb2 Mon Sep 17 00:00:00 2001 From: powturbo Date: Tue, 13 Jun 2017 09:14:19 +0200 Subject: [PATCH] TurboPFor: Bit Pack/UnPack c/c++ header --- bitpack.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/bitpack.h b/bitpack.h index 27ea0b6..c43c37a 100644 --- a/bitpack.h +++ b/bitpack.h @@ -24,13 +24,16 @@ // bitpack.h - "Integer Compression" Binary Packing header file #ifndef BITPACK_H_ #define BITPACK_H_ +#if defined(_MSC_VER) && _MSC_VER < 1600 +#include "vs/stdint.h" +#else +#include +#endif +#include #ifdef __cplusplus extern "C" { #endif -#include -#include - //******************** Bit Packing High Level API - n unlimited *************************************************** size_t bitnpack8( uint8_t *__restrict in, size_t n, unsigned char *__restrict out); size_t bitnpack16( uint16_t *__restrict in, size_t n, unsigned char *__restrict out); @@ -135,7 +138,7 @@ unsigned char *bitunpack64( const unsigned char *__restrict in, unsigned n, uint // ---------------- Direct Access to a single packed integer array entry -------------------------------------------------------------- #ifndef NTURBOPFOR_DAC - #if __AVX2__ + #if defined(__AVX2__) && defined(AVX2_ON) #include #define bzhi64(_u_, _b_) _bzhi_u64(_u_, _b_) #define bzhi32(_u_, _b_) _bzhi_u32(_u_, _b_)