Merge pull request #657 from Cyan4973/const_f

added __attribute__((const))
This commit is contained in:
Yann Collet
2021-12-11 14:35:25 -08:00
committed by GitHub

View File

@@ -227,18 +227,6 @@ extern "C" {
* Contains details on the public xxHash functions.
* @{
*/
/* specific declaration modes for Windows */
#if !defined(XXH_INLINE_ALL) && !defined(XXH_PRIVATE_API)
# if defined(WIN32) && defined(_MSC_VER) && (defined(XXH_IMPORT) || defined(XXH_EXPORT))
# ifdef XXH_EXPORT
# define XXH_PUBLIC_API __declspec(dllexport)
# elif XXH_IMPORT
# define XXH_PUBLIC_API __declspec(dllimport)
# endif
# else
# define XXH_PUBLIC_API /* do nothing */
# endif
#endif
#ifdef XXH_DOXYGEN
/*!
@@ -317,6 +305,29 @@ extern "C" {
#endif
/* *************************************
* Compiler specifics
***************************************/
/* specific declaration modes for Windows */
#if !defined(XXH_INLINE_ALL) && !defined(XXH_PRIVATE_API)
# if defined(WIN32) && defined(_MSC_VER) && (defined(XXH_IMPORT) || defined(XXH_EXPORT))
# ifdef XXH_EXPORT
# define XXH_PUBLIC_API __declspec(dllexport)
# elif XXH_IMPORT
# define XXH_PUBLIC_API __declspec(dllimport)
# endif
# else
# define XXH_PUBLIC_API /* do nothing */
# endif
#endif
#if defined (__GNUC__)
# define XXH_CONSTF __attribute__((const))
#else
# define XXH_CONSTF /* disable */
#endif
/* *************************************
* Version
***************************************/
@@ -333,7 +344,7 @@ extern "C" {
*
* @return `XXH_VERSION_NUMBER` of the invoked library.
*/
XXH_PUBLIC_API unsigned XXH_versionNumber (void);
XXH_PUBLIC_API XXH_CONSTF unsigned XXH_versionNumber (void);
/* ****************************