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