]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
fixed MEM_STATIC already defined in Linux Kernel mode 3676/head
authorYann Collet <cyan@fb.com>
Thu, 15 Jun 2023 03:03:39 +0000 (20:03 -0700)
committerYann Collet <cyan@fb.com>
Thu, 15 Jun 2023 03:07:18 +0000 (20:07 -0700)
contrib/linux-kernel/mem.h
lib/common/allocations.h
lib/common/compiler.h

index a7231822b6e32b626c857d128260aee5928eb694..2e91e7780c1fd556cb31e66e3a5d370bb56d2337 100644 (file)
@@ -24,6 +24,7 @@
 /*-****************************************
 *  Compiler specifics
 ******************************************/
+#undef MEM_STATIC /* may be already defined from common/compiler.h */
 #define MEM_STATIC static inline
 
 /*-**************************************************************
index a3153c4bac2b6162d9802085c8c09b3a5f98762f..5e8995501090fd631c0773e2c5ec233e7acc05e6 100644 (file)
@@ -14,7 +14,7 @@
 #define ZSTD_DEPS_NEED_MALLOC
 #include "zstd_deps.h"   /* ZSTD_malloc, ZSTD_calloc, ZSTD_free, ZSTD_memset */
 
-#include "mem.h" /* MEM_STATIC */
+#include "compiler.h" /* MEM_STATIC */
 #define ZSTD_STATIC_LINKING_ONLY
 #include "../zstd.h" /* ZSTD_customMem */
 
index 35b9c138793b539cd7d8aa65a2e0eed95ecbefbb..bcaa575dda6b1f629e985f1fad08cfef9324b636 100644 (file)
@@ -90,6 +90,7 @@
  * Updating the prefix is probably preferable, but requires a fairly large codemod,
  * since this name is used everywhere.
  */
+#ifndef MEM_STATIC  /* already defined in Linux Kernel mem.h */
 #if defined(__GNUC__)
 #  define MEM_STATIC static __inline UNUSED_ATTR
 #elif defined (__cplusplus) || (defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */)
 #else
 #  define MEM_STATIC static  /* this version may generate warnings for unused static functions; disable the relevant warning */
 #endif
+#endif
 
 /* force no inlining */
 #ifdef _MSC_VER