X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=include%2Fbyteswap.h;h=2e8b35bda48502181511ee00d27c8b285adb964e;hb=07495effe193ca3f73c3bf0ce417068f9ac9dcdd;hp=31b4e90e7045cf1b3837fe3301c6e0bd6c9ba642;hpb=93d248304a68de7a8f9daf4aa74f9ee4cd27410c;p=com%2Fgs-lite.git diff --git a/include/byteswap.h b/include/byteswap.h index 31b4e90..2e8b35b 100644 --- a/include/byteswap.h +++ b/include/byteswap.h @@ -1,54 +1,54 @@ -/* ------------------------------------------------ - Copyright 2014 AT&T Intellectual Property - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - ------------------------------------------- */ -#ifndef BYTESWAP_H -#define BYTESWAP_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include "gsconfig.h" -#include "gstypes.h" - - - gs_uint16_t gscpbswap16(gs_uint16_t); - gs_uint32_t gscpbswap32(gs_uint32_t); - gs_uint64_t gscpbswap64(gs_uint64_t); - -#ifdef __cplusplus -} -#endif - -#undef ntohl -#undef ntohs -#undef htons -#undef htonl -#undef htonll -#undef ntohll - - -#define ntohs(x) gscpbswap16((gs_uint16_t)(x)) -#define ntohl(x) gscpbswap32((gs_uint32_t)(x)) -#define ntohll(x) gscpbswap64((gs_uint64_t)(x)) -#define htons(x) gscpbswap16((gs_uint16_t)(x)) -#define htonl(x) gscpbswap32((gs_uint32_t)(x)) -#define htonll(x) gscpbswap64((gs_uint64_t)(x)) - -/* do nothing fo floating point numbers */ -#define htonf(x) (x) -#define ntohf(x) (x) - - -#endif +/* ------------------------------------------------ + Copyright 2014 AT&T Intellectual Property + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ------------------------------------------- */ +#ifndef BYTESWAP_H +#define BYTESWAP_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "gsconfig.h" +#include "gstypes.h" + + + gs_uint16_t gscpbswap16(gs_uint16_t); + gs_uint32_t gscpbswap32(gs_uint32_t); + gs_uint64_t gscpbswap64(gs_uint64_t); + +#ifdef __cplusplus +} +#endif + +#undef ntohl +#undef ntohs +#undef htons +#undef htonl +#undef htonll +#undef ntohll + + +#define ntohs(x) gscpbswap16((gs_uint16_t)(x)) +#define ntohl(x) gscpbswap32((gs_uint32_t)(x)) +#define ntohll(x) gscpbswap64((gs_uint64_t)(x)) +#define htons(x) gscpbswap16((gs_uint16_t)(x)) +#define htonl(x) gscpbswap32((gs_uint32_t)(x)) +#define htonll(x) gscpbswap64((gs_uint64_t)(x)) + +/* do nothing fo floating point numbers */ +#define htonf(x) (x) +#define ntohf(x) (x) + + +#endif