]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
[linux-kernel] Move ZSTD_STATIC_ASSERT to zstd_internal.h
authorNick Terrell <terrelln@fb.com>
Wed, 17 May 2017 21:51:41 +0000 (14:51 -0700)
committerNick Terrell <terrelln@fb.com>
Wed, 17 May 2017 21:51:50 +0000 (14:51 -0700)
contrib/linux-kernel/kernelize.sh
contrib/linux-kernel/lib/zstd/compress.c
contrib/linux-kernel/lib/zstd/zstd_internal.h

index 232fda80823950c5d3a94c987f8661ad020d185c..35ef5ed9f2b771c59f2c82fde88950843eac5d33 100755 (executable)
@@ -30,6 +30,10 @@ function check_not_present_in_file() {
   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}
 
 prompt "Do you wish to replace 4 spaces with a tab?"
@@ -88,7 +92,10 @@ fi
 prompt "Do you wish to run some checks?"
 if [ ! -z "$yes" ]
 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 "#define ZSTD_STATIC_ASSERT" ${LIB}compress.c
+  check_not_present MEM_STATIC
   check_not_present "#if 0"
   check_not_present "#if 1"
   check_not_present _MSC_VER
index a7629aed5052bd486820696db2d46872739e34f9..6c07a04ccc7ea21656138197bdca92b5e76ae608 100644 (file)
@@ -35,10 +35,6 @@ typedef enum { ZSTDcs_created = 0, ZSTDcs_init, ZSTDcs_ongoing, ZSTDcs_ending }
 /*-*************************************
 *  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; }
 
 /*-*************************************
index cbb61c429106bc47b18536cccc349beb2d9227ef..67487199eb549ef44e1222f518c695c6c99926bf 100644 (file)
                if (ERR_isError(errcod)) \
                        return ERROR(e); \
        } /* check and send Error code */
+#define ZSTD_STATIC_ASSERT(c)                                   \
+       {                                                       \
+               enum { ZSTD_static_assert = 1 / (int)(!!(c)) }; \
+       }
 
 /*-*************************************
 *  Common constants