Tweaks to create a single-file decoder
The CHECK_F macros differ slightly (but eventually do the same thing). Older GCC needs to fallback on the old-style pragma optimisation flags.
This commit is contained in:
parent
69c875a0cc
commit
901ea61f83
@ -127,9 +127,14 @@
|
|||||||
} \
|
} \
|
||||||
}
|
}
|
||||||
|
|
||||||
/* vectorization */
|
/* vectorization
|
||||||
|
* older GCC (pre gcc-4.3 picked as the cutoff) uses a different syntax */
|
||||||
#if !defined(__clang__) && defined(__GNUC__)
|
#if !defined(__clang__) && defined(__GNUC__)
|
||||||
# define DONT_VECTORIZE __attribute__((optimize("no-tree-vectorize")))
|
# if (__GNUC__ == 4 && __GNUC_MINOR__ > 3) || (__GNUC__ >= 5)
|
||||||
|
# define DONT_VECTORIZE __attribute__((optimize("no-tree-vectorize")))
|
||||||
|
# else
|
||||||
|
# define DONT_VECTORIZE _Pragma("GCC optimize(\"no-tree-vectorize\")")
|
||||||
|
# endif
|
||||||
#else
|
#else
|
||||||
# define DONT_VECTORIZE
|
# define DONT_VECTORIZE
|
||||||
#endif
|
#endif
|
||||||
|
@ -52,7 +52,9 @@
|
|||||||
#define FSE_STATIC_ASSERT(c) DEBUG_STATIC_ASSERT(c) /* use only *after* variable declarations */
|
#define FSE_STATIC_ASSERT(c) DEBUG_STATIC_ASSERT(c) /* use only *after* variable declarations */
|
||||||
|
|
||||||
/* check and forward error code */
|
/* check and forward error code */
|
||||||
|
#ifndef CHECK_F
|
||||||
#define CHECK_F(f) { size_t const e = f; if (FSE_isError(e)) return e; }
|
#define CHECK_F(f) { size_t const e = f; if (FSE_isError(e)) return e; }
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* **************************************************************
|
/* **************************************************************
|
||||||
|
@ -61,7 +61,9 @@
|
|||||||
* Error Management
|
* Error Management
|
||||||
****************************************************************/
|
****************************************************************/
|
||||||
#define HUF_isError ERR_isError
|
#define HUF_isError ERR_isError
|
||||||
|
#ifndef CHECK_F
|
||||||
#define CHECK_F(f) { size_t const err_ = (f); if (HUF_isError(err_)) return err_; }
|
#define CHECK_F(f) { size_t const err_ = (f); if (HUF_isError(err_)) return err_; }
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* **************************************************************
|
/* **************************************************************
|
||||||
|
Loading…
Reference in New Issue
Block a user