1*c7e47104Szrj /* 2*c7e47104Szrj * Copyright (c) 2021 The DragonFly Project. All rights reserved. 3*c7e47104Szrj * 4*c7e47104Szrj * Redistribution and use in source and binary forms, with or without 5*c7e47104Szrj * modification, are permitted provided that the following conditions 6*c7e47104Szrj * are met: 7*c7e47104Szrj * 1. Redistributions of source code must retain the above copyright 8*c7e47104Szrj * notice, this list of conditions and the following disclaimer. 9*c7e47104Szrj * 2. Redistributions in binary form must reproduce the above copyright 10*c7e47104Szrj * notice, this list of conditions and the following disclaimer in the 11*c7e47104Szrj * documentation and/or other materials provided with the distribution. 12*c7e47104Szrj * 13*c7e47104Szrj * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 14*c7e47104Szrj * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 15*c7e47104Szrj * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 16*c7e47104Szrj * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 17*c7e47104Szrj * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 18*c7e47104Szrj * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, 19*c7e47104Szrj * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 20*c7e47104Szrj * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 21*c7e47104Szrj * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 22*c7e47104Szrj * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 23*c7e47104Szrj * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24*c7e47104Szrj * SUCH DAMAGE. 25*c7e47104Szrj */ 26*c7e47104Szrj 27*c7e47104Szrj #ifndef _BYTESWAP_H_ 28*c7e47104Szrj #define _BYTESWAP_H_ 29*c7e47104Szrj 30*c7e47104Szrj #include <sys/endian.h> /* pollution intentional */ 31*c7e47104Szrj 32*c7e47104Szrj /* 33*c7e47104Szrj * This header is for compatibility only. 34*c7e47104Szrj */ 35*c7e47104Szrj #define bswap_16(x) __bswap16((x)) 36*c7e47104Szrj #define bswap_32(x) __bswap32((x)) 37*c7e47104Szrj #define bswap_64(x) __bswap64((x)) 38*c7e47104Szrj 39*c7e47104Szrj #endif /* !_BYTESWAP_H_ */ 40