Menu

LZma SDK minor fix for compatibility with android NDK (just add one include)

2015-09-03
2015-09-03
  • Gilles Vollant

    Gilles Vollant - 2015-09-03

    android jdk need include string.h to use memset

    so in
    lzma_sdk/C/Ppmd7.c
    I include string.h in addition to memory.h

    jni/../../PatchClient/difstrm/lzma_sdk/C/Ppmd7.c: In function 'Ppmd7_Construct':
    jni/../../PatchClient/difstrm/lzma_sdk/C/Ppmd7.c:73:3: warning: incompatible implicit declaration of built-in function 'memset' [enabled by default]
    memset(p->NS2BSIndx + 2, (2 << 1), 9);
    ^
    jni/../../PatchClient/difstrm/lzma_sdk/C/Ppmd7.c: In function 'RestartModel':
    jni/../../PatchClient/difstrm/lzma_sdk/C/Ppmd7.c:289:3: warning: incompatible implicit declaration of built-in function 'memset' [enabled by default]
    memset(p->FreeList, 0, sizeof(p->FreeList));
    ^

    replace

    include <memory.h>

    by

    include <memory.h>

    include <string.h>

     
  • Igor Pavlov

    Igor Pavlov - 2015-09-03

    I suppose that we don't need <memory.h>, if we use <string.h>.
    Am I right?

     
    • İsmail Dönmez

      İsmail Dönmez - 2015-09-03

      Yes, string.h defines memset.

       

Log in to post a comment.