ckolivas / lrzip

Long Range Zip
http://lrzip.kolivas.org
GNU General Public License v2.0
618 stars 76 forks source link

warning: 'PAGE_SIZE' macro redefined #201

Closed leleliu008 closed 2 years ago

leleliu008 commented 3 years ago
lrzip_private.h:266:10: warning: 'PAGE_SIZE' macro redefined [-Wmacro-redefined]
# define PAGE_SIZE (4096)/usr/local/opt/android-sdk/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/sys/user.h
         ^
/usr/local/opt/android-sdk/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/sys/user.h:38:9: note: previous definition is here
#define PAGE_SIZE 4096
        ^
:38:9: note: previous definition is here
#define PAGE_SIZE 4096

PAGE_SIZE has been predefined in Android-NDK.

relavent code

so here should check PAGE_SIZE if already defined

#ifndef PAGE_SIZE
    #ifdef _SC_PAGE_SIZE
        #define PAGE_SIZE (sysconf(_SC_PAGE_SIZE))
    #else
        #define PAGE_SIZE (4096)
    #endif
#endif
ckolivas commented 2 years ago

Fixed in master.