xref: /freebsd-src/sys/contrib/openzfs/include/os/freebsd/linux/compiler.h (revision b487b1f502899530951bd3923b3927c067d13ffb)
1eda14cbcSMatt Macy /*
2*b487b1f5SWarner Losh  * Copyright (c) 2024 Warner Losh.
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
6eda14cbcSMatt Macy  * are met:
7eda14cbcSMatt Macy  * 1. Redistributions of source code must retain the above copyright
8eda14cbcSMatt Macy  *    notice unmodified, this list of conditions, and the following
9eda14cbcSMatt Macy  *    disclaimer.
10eda14cbcSMatt Macy  * 2. Redistributions in binary form must reproduce the above copyright
11eda14cbcSMatt Macy  *    notice, this list of conditions and the following disclaimer in the
12eda14cbcSMatt Macy  *    documentation and/or other materials provided with the distribution.
13eda14cbcSMatt Macy  *
14eda14cbcSMatt Macy  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
15eda14cbcSMatt Macy  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
16eda14cbcSMatt Macy  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
17eda14cbcSMatt Macy  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
18eda14cbcSMatt Macy  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
19eda14cbcSMatt Macy  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20eda14cbcSMatt Macy  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
21eda14cbcSMatt Macy  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22eda14cbcSMatt Macy  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23eda14cbcSMatt Macy  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24eda14cbcSMatt Macy  */
25eda14cbcSMatt Macy 
26*b487b1f5SWarner Losh /*
27*b487b1f5SWarner Losh  * FreeBSD's LinuxKPI compiler.h as far back as FreeBSD 12 has what we need,
28*b487b1f5SWarner Losh  * except zfs_fallthrough.
29*b487b1f5SWarner Losh  */
30*b487b1f5SWarner Losh #pragma once
31eda14cbcSMatt Macy 
32*b487b1f5SWarner Losh #include <compat/linuxkpi/common/include/linux/compiler.h>
33*b487b1f5SWarner Losh 
34c03c5b1cSMartin Matuska #define	zfs_fallthrough			__attribute__((__fallthrough__))
35