Parolin
0.7.9 6796
Console (soon DLLs) to do a tar like job
Loading...
Searching...
No Matches
val
xcx_Zstandard
zstd-1.5.2
lib
common
portability_macros.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) Facebook, Inc.
3
* All rights reserved.
4
*
5
* This source code is licensed under both the BSD-style license (found in the
6
* LICENSE file in the root directory of this source tree) and the GPLv2 (found
7
* in the COPYING file in the root directory of this source tree).
8
* You may select, at your option, one of the above-listed licenses.
9
*/
10
11
#ifndef ZSTD_PORTABILITY_MACROS_H
12
#define ZSTD_PORTABILITY_MACROS_H
13
24
/* compat. with non-clang compilers */
25
#ifndef __has_attribute
26
#define __has_attribute(x) 0
27
#endif
28
29
/* compat. with non-clang compilers */
30
#ifndef __has_builtin
31
# define __has_builtin(x) 0
32
#endif
33
34
/* compat. with non-clang compilers */
35
#ifndef __has_feature
36
# define __has_feature(x) 0
37
#endif
38
39
/* detects whether we are being compiled under msan */
40
#ifndef ZSTD_MEMORY_SANITIZER
41
# if __has_feature(memory_sanitizer)
42
# define ZSTD_MEMORY_SANITIZER 1
43
# else
44
# define ZSTD_MEMORY_SANITIZER 0
45
# endif
46
#endif
47
48
/* detects whether we are being compiled under asan */
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
54
# else
55
# define ZSTD_ADDRESS_SANITIZER 0
56
# endif
57
#endif
58
59
/* detects whether we are being compiled under dfsan */
60
#ifndef ZSTD_DATAFLOW_SANITIZER
61
# if __has_feature(dataflow_sanitizer)
62
# define ZSTD_DATAFLOW_SANITIZER 1
63
# else
64
# define ZSTD_DATAFLOW_SANITIZER 0
65
# endif
66
#endif
67
68
/* Mark the internal assembly functions as hidden */
69
#ifdef __ELF__
70
# define ZSTD_HIDE_ASM_FUNCTION(func) .hidden func
71
#else
72
# define ZSTD_HIDE_ASM_FUNCTION(func)
73
#endif
74
75
/* Enable runtime BMI2 dispatch based on the CPU.
76
* Enabled for clang & gcc >=4.8 on x86 when BMI2 isn't enabled by default.
77
*/
78
#ifndef DYNAMIC_BMI2
79
#if ((defined(__clang__) && __has_attribute(__target__)) \
80
|| (defined(__GNUC__) \
81
&& (__GNUC__ >= 5 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)))) \
82
&& (defined(__x86_64__) || defined(_M_X64)) \
83
&& !defined(__BMI2__)
84
# define DYNAMIC_BMI2 1
85
#else
86
# define DYNAMIC_BMI2 0
87
#endif
88
#endif
89
101
#if defined(__GNUC__)
102
# if defined(__linux__) || defined(__linux) || defined(__APPLE__)
103
# if ZSTD_MEMORY_SANITIZER
104
# define ZSTD_ASM_SUPPORTED 0
105
# elif ZSTD_DATAFLOW_SANITIZER
106
# define ZSTD_ASM_SUPPORTED 0
107
# else
108
# define ZSTD_ASM_SUPPORTED 1
109
# endif
110
# else
111
# define ZSTD_ASM_SUPPORTED 0
112
# endif
113
#else
114
# define ZSTD_ASM_SUPPORTED 0
115
#endif
116
128
#if !defined(ZSTD_DISABLE_ASM) && \
129
ZSTD_ASM_SUPPORTED && \
130
defined(__x86_64__) && \
131
(DYNAMIC_BMI2 || defined(__BMI2__))
132
# define ZSTD_ENABLE_ASM_X86_64_BMI2 1
133
#else
134
# define ZSTD_ENABLE_ASM_X86_64_BMI2 0
135
#endif
136
137
#endif
/* ZSTD_PORTABILITY_MACROS_H */
Generated by
1.12.0