[FDT] Fix POSIX compatibility for string.h (#6923)
* [FDT] Fix POSIX compatibility for string.h * [FDT] format libfdt code. * [FDT] format libfdt code.
This commit is contained in:
parent
03bcd0701c
commit
fc1aced665
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2006-2021, RT-Thread Development Team
|
||||
* Copyright (c) 2006-2023, RT-Thread Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
|
|
@ -139,6 +139,13 @@
|
|||
|
||||
#define FDT_ERR_MAX 17
|
||||
|
||||
/* string.h for POSIX compatibility */
|
||||
#include <string.h>
|
||||
typedef unsigned int uint;
|
||||
size_t strnlen (const char *, size_t);
|
||||
char *strdup (const char *);
|
||||
char *strchrnul (const char *, int);
|
||||
|
||||
/**********************************************************************/
|
||||
/* Low-level functions (you probably don't need these) */
|
||||
/**********************************************************************/
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
/*
|
||||
* Copyright (c) 2006-2022, RT-Thread Development Team
|
||||
* Copyright (c) 2006-2023, RT-Thread Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#define _GNU_SOURCE
|
||||
|
||||
#include "libfdt.h"
|
||||
#include "dtb_node.h"
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2006-2022, RT-Thread Development Team
|
||||
* Copyright (c) 2006-2023, RT-Thread Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2006-2022, RT-Thread Development Team
|
||||
* Copyright (c) 2006-2023, RT-Thread Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
@ -189,7 +189,7 @@ const char *dtb_node_get_name(const struct dtb_node *node)
|
|||
|
||||
}
|
||||
|
||||
struct dtb_node *dtb_node_get_by_phandle(uint phandle)
|
||||
struct dtb_node *dtb_node_get_by_phandle(uint32_t phandle)
|
||||
{
|
||||
if (dtb_node_active())
|
||||
return dtb_node_find_node_by_phandle(phandle);
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#include "libfdt.h"
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include "dtb_node.h"
|
||||
|
||||
|
|
Loading…
Reference in New Issue