mirror of
https://github.com/facebook/zstd.git
synced 2025-07-30 22:23:13 +03:00
[linux-kernel] Move ZSTD_STATIC_ASSERT to zstd_internal.h
This commit is contained in:
@ -30,6 +30,10 @@ function check_not_present_in_file() {
|
|||||||
grep "$1" "$2" && exit 1 || true
|
grep "$1" "$2" && exit 1 || true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function check_present_in_file() {
|
||||||
|
grep "$1" "$2" > /dev/null 2> /dev/null || exit 1
|
||||||
|
}
|
||||||
|
|
||||||
echo "Files: " $INCLUDE*.h $LIB*.{h,c}
|
echo "Files: " $INCLUDE*.h $LIB*.{h,c}
|
||||||
|
|
||||||
prompt "Do you wish to replace 4 spaces with a tab?"
|
prompt "Do you wish to replace 4 spaces with a tab?"
|
||||||
@ -88,7 +92,10 @@ fi
|
|||||||
prompt "Do you wish to run some checks?"
|
prompt "Do you wish to run some checks?"
|
||||||
if [ ! -z "$yes" ]
|
if [ ! -z "$yes" ]
|
||||||
then
|
then
|
||||||
|
check_present_in_file ZSTD_STATIC_ASSERT ${LIB}zstd_internal.h
|
||||||
check_not_present_in_file STATIC_ASSERT ${LIB}mem.h
|
check_not_present_in_file STATIC_ASSERT ${LIB}mem.h
|
||||||
|
check_not_present_in_file "#define ZSTD_STATIC_ASSERT" ${LIB}compress.c
|
||||||
|
check_not_present MEM_STATIC
|
||||||
check_not_present "#if 0"
|
check_not_present "#if 0"
|
||||||
check_not_present "#if 1"
|
check_not_present "#if 1"
|
||||||
check_not_present _MSC_VER
|
check_not_present _MSC_VER
|
||||||
|
@ -35,10 +35,6 @@ typedef enum { ZSTDcs_created = 0, ZSTDcs_init, ZSTDcs_ongoing, ZSTDcs_ending }
|
|||||||
/*-*************************************
|
/*-*************************************
|
||||||
* Helper functions
|
* Helper functions
|
||||||
***************************************/
|
***************************************/
|
||||||
#define ZSTD_STATIC_ASSERT(c) \
|
|
||||||
{ \
|
|
||||||
enum { ZSTD_static_assert = 1 / (int)(!!(c)) }; \
|
|
||||||
}
|
|
||||||
size_t ZSTD_compressBound(size_t srcSize) { return FSE_compressBound(srcSize) + 12; }
|
size_t ZSTD_compressBound(size_t srcSize) { return FSE_compressBound(srcSize) + 12; }
|
||||||
|
|
||||||
/*-*************************************
|
/*-*************************************
|
||||||
|
@ -50,6 +50,10 @@
|
|||||||
if (ERR_isError(errcod)) \
|
if (ERR_isError(errcod)) \
|
||||||
return ERROR(e); \
|
return ERROR(e); \
|
||||||
} /* check and send Error code */
|
} /* check and send Error code */
|
||||||
|
#define ZSTD_STATIC_ASSERT(c) \
|
||||||
|
{ \
|
||||||
|
enum { ZSTD_static_assert = 1 / (int)(!!(c)) }; \
|
||||||
|
}
|
||||||
|
|
||||||
/*-*************************************
|
/*-*************************************
|
||||||
* Common constants
|
* Common constants
|
||||||
|
Reference in New Issue
Block a user