libc/impure: Fix the inconsistence from the different toolchain
some toolchain provider remove const qualifier from global_impure_ptr (e.g. Espressif) but other provider keep it(e.g. ARM or Cadence), so let's define const to empty macro to pass the compile and more safety. Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
parent
fe723f0715
commit
4e92e32d7b
|
@ -25,6 +25,7 @@
|
||||||
#if defined(__has_include)
|
#if defined(__has_include)
|
||||||
# if __has_include(<reent.h>)
|
# if __has_include(<reent.h>)
|
||||||
|
|
||||||
|
#define const
|
||||||
#include <reent.h>
|
#include <reent.h>
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
@ -44,9 +45,9 @@
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifdef _REENT_SMALL
|
#ifdef _REENT_SMALL
|
||||||
extern const struct __sFILE_fake __sf_fake_stdin _ATTRIBUTE((weak));
|
extern struct __sFILE_fake __sf_fake_stdin _ATTRIBUTE((weak));
|
||||||
extern const struct __sFILE_fake __sf_fake_stdout _ATTRIBUTE((weak));
|
extern struct __sFILE_fake __sf_fake_stdout _ATTRIBUTE((weak));
|
||||||
extern const struct __sFILE_fake __sf_fake_stderr _ATTRIBUTE((weak));
|
extern struct __sFILE_fake __sf_fake_stderr _ATTRIBUTE((weak));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static struct _reent __ATTRIBUTE_IMPURE_DATA__
|
static struct _reent __ATTRIBUTE_IMPURE_DATA__
|
||||||
|
@ -59,13 +60,8 @@ extern struct _reent reent_data __attribute__((alias("impure_data")));
|
||||||
struct _reent *__ATTRIBUTE_IMPURE_PTR__
|
struct _reent *__ATTRIBUTE_IMPURE_PTR__
|
||||||
_impure_ptr = &impure_data;
|
_impure_ptr = &impure_data;
|
||||||
|
|
||||||
#ifdef CONFIG_ARCH_XTENSA
|
|
||||||
struct _reent *__ATTRIBUTE_IMPURE_PTR__
|
struct _reent *__ATTRIBUTE_IMPURE_PTR__
|
||||||
_global_impure_ptr = &impure_data;
|
_global_impure_ptr = &impure_data;
|
||||||
#else
|
|
||||||
struct _reent *const __ATTRIBUTE_IMPURE_PTR__
|
|
||||||
_global_impure_ptr = &impure_data;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
# endif /* __has_include(<reent.h>) */
|
# endif /* __has_include(<reent.h>) */
|
||||||
#endif /* defined(__has_include) */
|
#endif /* defined(__has_include) */
|
||||||
|
|
Loading…
Reference in New Issue