Loading...
Searching...
No Matches
Go to the documentation of this file.
11#ifndef ZSTD_PORTABILITY_MACROS_H
12#define ZSTD_PORTABILITY_MACROS_H
25#ifndef __has_attribute
26 #define __has_attribute(x) 0
31# define __has_builtin(x) 0
36# define __has_feature(x) 0
40#ifndef ZSTD_MEMORY_SANITIZER
41# if __has_feature(memory_sanitizer)
42# define ZSTD_MEMORY_SANITIZER 1
44# define ZSTD_MEMORY_SANITIZER 0
49#ifndef ZSTD_ADDRESS_SANITIZER
50# if __has_feature(address_sanitizer)
51# define ZSTD_ADDRESS_SANITIZER 1
52# elif defined(__SANITIZE_ADDRESS__)
53# define ZSTD_ADDRESS_SANITIZER 1
55# define ZSTD_ADDRESS_SANITIZER 0
60#ifndef ZSTD_DATAFLOW_SANITIZER
61# if __has_feature(dataflow_sanitizer)
62# define ZSTD_DATAFLOW_SANITIZER 1
64# define ZSTD_DATAFLOW_SANITIZER 0
70# define ZSTD_HIDE_ASM_FUNCTION(func) .hidden func
71#elif defined(__APPLE__)
72# define ZSTD_HIDE_ASM_FUNCTION(func) .private_extern func
74# define ZSTD_HIDE_ASM_FUNCTION(func)
81 #if ((defined(__clang__) && __has_attribute(__target__)) \
82 || (defined(__GNUC__) \
83 && (__GNUC__ >= 5 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)))) \
84 && (defined(__x86_64__) || defined(_M_X64)) \
86 # define DYNAMIC_BMI2 1
88 # define DYNAMIC_BMI2 0
104# if defined(__linux__) || defined(__linux) || defined(__APPLE__)
105# if ZSTD_MEMORY_SANITIZER
106# define ZSTD_ASM_SUPPORTED 0
107# elif ZSTD_DATAFLOW_SANITIZER
108# define ZSTD_ASM_SUPPORTED 0
110# define ZSTD_ASM_SUPPORTED 1
113# define ZSTD_ASM_SUPPORTED 0
116# define ZSTD_ASM_SUPPORTED 0
130#if !defined(ZSTD_DISABLE_ASM) && \
131 ZSTD_ASM_SUPPORTED && \
132 defined(__x86_64__) && \
133 (DYNAMIC_BMI2 || defined(__BMI2__))
134# define ZSTD_ENABLE_ASM_X86_64_BMI2 1
136# define ZSTD_ENABLE_ASM_X86_64_BMI2 0
146#if defined(__ELF__) && (defined(__x86_64__) || defined(__i386__)) \
147 && defined(__has_include)
148# if __has_include(<cet.h>)
150# define ZSTD_CET_ENDBRANCH _CET_ENDBR
154#ifndef ZSTD_CET_ENDBRANCH
155# define ZSTD_CET_ENDBRANCH