Skip to content

Commit 6f8ce38

Browse files
Francesco Giancaneigrr
authored andcommitted
Introduce <endian.h> compatibility header
Programs and libraries using compiler and system information about endianness often include the system header `<endian.h>`. In `xtensa-gcc` compiler with `newlib` distribution, that file is located in `<machine/endian.h>`; this means that `#include <endian.h>` would fail at compile time. This commit fixes the issue by adding a compatibility `<endian.h>` header which in turn just includes `<machine/endian.h>`. Signed-off-by: Francesco Giancane <[email protected]> Merges espressif/esp-idf#4784
1 parent 4d53c13 commit 6f8ce38

File tree

1 file changed

+25
-0
lines changed
  • components/newlib/platform_include

1 file changed

+25
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Copyright 2018 Espressif Systems (Shanghai) PTE LTD
2+
// Copyright 2020 Francesco Giancane <[email protected]>
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+
// http://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+
16+
/*
17+
* This is a compatibility header for <endian.h>.
18+
* In xtensa-newlib distribution it is located in <machine/endian.h>
19+
* but most program expect to be plain <endian.h>.
20+
*/
21+
22+
#ifndef XTENSA_COMPAT_ENDIAN_H_INCLUDED
23+
#define XTENSA_COMPAT_ENDIAN_H_INCLUDED
24+
#include <machine/endian.h>
25+
#endif /* XTENSA_COMPAT_ENDIAN_H_INCLUDED */

0 commit comments

Comments
 (0)