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