Skip to content

Commit 2c97161

Browse files
committed
add macOS implementation of htole16
1 parent 152c3ed commit 2c97161

File tree

1 file changed

+14
-15
lines changed

1 file changed

+14
-15
lines changed

library/endian_internal.h

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
1-
/*
2-
Copyright 2019-2020 NetFoundry, Inc.
3-
4-
Licensed under the Apache License, Version 2.0 (the "License");
5-
you may not use this file except in compliance with the License.
6-
You may obtain a copy of the License at
7-
8-
https://www.apache.org/licenses/LICENSE-2.0
9-
10-
Unless required by applicable law or agreed to in writing, software
11-
distributed under the License is distributed on an "AS IS" BASIS,
12-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
See the License for the specific language governing permissions and
14-
limitations under the License.
15-
*/
1+
// Copyright (c) 2023. NetFoundry Inc.
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// https://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
1614

1715
#ifndef ZITI_SDK_ENDIAN_INTERNAL_H
1816
#define ZITI_SDK_ENDIAN_INTERNAL_H
@@ -26,6 +24,7 @@ limitations under the License.
2624
# include <endian.h>
2725
#elif defined (__APPLE__)
2826
# include <libkern/OSByteOrder.h>
27+
# define htole16(x) OSSwapHostToLittleInt16(x)
2928
# define htole32(x) OSSwapHostToLittleInt32(x)
3029
# define htole64(x) OSSwapHostToLittleInt64(x)
3130
# define le32toh(x) OSSwapLittleToHostInt32(x)

0 commit comments

Comments
 (0)