1*eda14cbcSMatt Macy /*
2*eda14cbcSMatt Macy  * BSD 3-Clause New License (https://spdx.org/licenses/BSD-3-Clause.html)
3*eda14cbcSMatt Macy  *
4*eda14cbcSMatt Macy  * Redistribution and use in source and binary forms, with or without
5*eda14cbcSMatt Macy  * modification, are permitted provided that the following conditions are met:
6*eda14cbcSMatt Macy  *
7*eda14cbcSMatt Macy  * 1. Redistributions of source code must retain the above copyright notice,
8*eda14cbcSMatt Macy  * this list of conditions and the following disclaimer.
9*eda14cbcSMatt Macy  *
10*eda14cbcSMatt Macy  * 2. Redistributions in binary form must reproduce the above copyright notice,
11*eda14cbcSMatt Macy  * this list of conditions and the following disclaimer in the documentation
12*eda14cbcSMatt Macy  * and/or other materials provided with the distribution.
13*eda14cbcSMatt Macy  *
14*eda14cbcSMatt Macy  * 3. Neither the name of the copyright holder nor the names of its
15*eda14cbcSMatt Macy  * contributors may be used to endorse or promote products derived from this
16*eda14cbcSMatt Macy  * software without specific prior written permission.
17*eda14cbcSMatt Macy  *
18*eda14cbcSMatt Macy  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19*eda14cbcSMatt Macy  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20*eda14cbcSMatt Macy  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21*eda14cbcSMatt Macy  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
22*eda14cbcSMatt Macy  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23*eda14cbcSMatt Macy  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24*eda14cbcSMatt Macy  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25*eda14cbcSMatt Macy  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26*eda14cbcSMatt Macy  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27*eda14cbcSMatt Macy  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28*eda14cbcSMatt Macy  * POSSIBILITY OF SUCH DAMAGE.
29*eda14cbcSMatt Macy  */
30*eda14cbcSMatt Macy 
31*eda14cbcSMatt Macy /*
32*eda14cbcSMatt Macy  * Copyright (c) 2014-2019, Allan Jude
33*eda14cbcSMatt Macy  * Copyright (c) 2020, Brian Behlendorf
34*eda14cbcSMatt Macy  * Copyright (c) 2020, Michael Niewöhner
35*eda14cbcSMatt Macy  */
36*eda14cbcSMatt Macy 
37*eda14cbcSMatt Macy #ifndef	_ZSTD_LIMITS_H
38*eda14cbcSMatt Macy #define	_ZSTD_LIMITS_H
39*eda14cbcSMatt Macy 
40*eda14cbcSMatt Macy #ifdef __cplusplus
41*eda14cbcSMatt Macy extern "C" {
42*eda14cbcSMatt Macy #endif
43*eda14cbcSMatt Macy 
44*eda14cbcSMatt Macy #ifdef _KERNEL
45*eda14cbcSMatt Macy 
46*eda14cbcSMatt Macy #if defined(__FreeBSD__)
47*eda14cbcSMatt Macy #include <sys/limits.h>
48*eda14cbcSMatt Macy #elif defined(__linux__)
49*eda14cbcSMatt Macy #include <linux/limits.h>
50*eda14cbcSMatt Macy #include <linux/kernel.h>
51*eda14cbcSMatt Macy #else
52*eda14cbcSMatt Macy #error "Unsupported platform"
53*eda14cbcSMatt Macy #endif
54*eda14cbcSMatt Macy 
55*eda14cbcSMatt Macy #else /* !_KERNEL */
56*eda14cbcSMatt Macy #include_next <limits.h>
57*eda14cbcSMatt Macy #endif /* _KERNEL */
58*eda14cbcSMatt Macy 
59*eda14cbcSMatt Macy #ifdef __cplusplus
60*eda14cbcSMatt Macy }
61*eda14cbcSMatt Macy #endif
62*eda14cbcSMatt Macy 
63*eda14cbcSMatt Macy #endif /* _ZSTD_LIMITS_H */
64