 #include <stdint.h>
 #include <string.h>
 #include <limits.h>
-#include <cuda.h>
+#include <unistd.h>
 
 #include "common.h"
-#include "lzss_gpu_help.h"
+#include "lzss_help.h"
 
 #define DISP_BITS 11
 #define LEN_BITS 4

#define TO_BOT(i) MATCH_BOT((i))
#define PACK(d,l) (TO_TOP((d)) | TO_BOT((l)))

__device__ void pack_match(match_t* match, match_expanded_t* expanded)
{
  match->dl = PACK(expanded->d-1,expanded->l-2);
}

    {
      /* match.d is displacement */
      /* match.l is length of match */
      IDX_BY_BIT(flags,b) |= PUT_BIT(1,b);
      pack_match(&m,&match);
      memcpy(dst + w,&m,sizeof(match_t));
      i += match.l;
      w += sizeof(match_t);
      b++;
