Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions bsp/abstract-machine/include/extra.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
typedef long suseconds_t;
typedef unsigned long useconds_t;
#include <sys/types.h>


#ifdef __ISA_NATIVE__
#include <sys/types.h>
// rename posix API to avoid conflict with glibc in native
#define open rt_open
#define creat rt_creat
Expand Down Expand Up @@ -34,5 +33,7 @@ typedef unsigned long useconds_t;
#define getcwd rt_getcwd

#define gettimeofday rt_gettimeofday

#else
typedef long suseconds_t;
typedef unsigned long useconds_t;
#endif
1 change: 1 addition & 0 deletions components/libc/compilers/common/cstdlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* 2021-02-15 Meco Man first version
*/

#include <stddef.h>
#include <rtthread.h>

#define DBG_TAG "stdlib"
Expand Down
4 changes: 2 additions & 2 deletions components/libc/compilers/common/cstring.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ void explicit_bzero(void* s, size_t n)

char* index(const char* s, int c)
{
return strchr(s, c);
return (char*)strchr(s, c);
}

char* rindex(const char* s, int c)
{
return strrchr(s, c);
return (char*)strrchr(s, c);
}

int ffs(int i)
Expand Down
3 changes: 2 additions & 1 deletion components/libc/compilers/common/include/sys/select.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@

#include <rtconfig.h>
#include <sys/types.h>
#include <sys/time.h>

struct timeval;

#ifdef __cplusplus
extern "C" {
Expand Down
2 changes: 1 addition & 1 deletion components/libc/compilers/common/include/sys/time.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ struct timezone
int tz_dsttime; /* type of dst correction */
};

#ifndef _TIMEVAL_DEFINED
#if !defined (_TIMEVAL_DEFINED) &&!defined (__timeval_defined)
#define _TIMEVAL_DEFINED
struct timeval
{
Expand Down
4 changes: 2 additions & 2 deletions components/utilities/utest/utest.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ static const char *file_basename(const char *file)
char *end_ptr = RT_NULL;
char *rst = RT_NULL;

if (!((end_ptr = strrchr(file, '\\')) != RT_NULL || \
(end_ptr = strrchr(file, '/')) != RT_NULL) || \
if (!((end_ptr = (char*)strrchr(file, '\\')) != RT_NULL || \
(end_ptr = (char*)strrchr(file, '/')) != RT_NULL) || \
(rt_strlen(file) < 2))
{
rst = (char *)file;
Expand Down