]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Add support for MCST LCC compiler
authormakise-homura <akemi_homura@kurisa.ch>
Sat, 10 Jul 2021 00:57:06 +0000 (03:57 +0300)
committermakise-homura <akemi_homura@kurisa.ch>
Sat, 10 Jul 2021 00:57:06 +0000 (03:57 +0300)
lib/common/compiler.h
programs/zstdcli.c

index 9e2a8fe70fd8d352171a6dacc009df747373254f..cae0061a168d00c6ce4c1d6a938a8dd2dad828dd 100644 (file)
 #  define UNUSED_ATTR
 #endif
 
+/* CONST_ARGC tells the compiler correct const argc specificator for -Wmain. */
+#if !defined(__LCC__)
+#  define CONST_ARGC const
+#else
+#  define CONST_ARGC
+#endif
+
 /* force no inlining */
 #ifdef _MSC_VER
 #  define FORCE_NOINLINE static __declspec(noinline)
 
 /* vectorization
  * older GCC (pre gcc-4.3 picked as the cutoff) uses a different syntax */
-#if !defined(__INTEL_COMPILER) && !defined(__clang__) && defined(__GNUC__)
+#if !defined(__INTEL_COMPILER) && !defined(__clang__) && defined(__GNUC__) && !defined(__LCC__)
 #  if (__GNUC__ == 4 && __GNUC_MINOR__ > 3) || (__GNUC__ >= 5)
 #    define DONT_VECTORIZE __attribute__((optimize("no-tree-vectorize")))
 #  else
index e496852f3fbb1a7732a386624a9f9cb62be0ea12..845610dc303be795b1f24e8cfc1f21361cb8ba3c 100644 (file)
@@ -741,7 +741,7 @@ typedef enum { zom_compress, zom_decompress, zom_test, zom_bench, zom_train, zom
 # define MAXCLEVEL  ZSTD_maxCLevel()
 #endif
 
-int main(int const argCount, const char* argv[])
+int main(int CONST_ARGC argCount, const char* argv[])
 {
     int argNb,
         followLinks = 0,