feat: make compatible with openperf
This commit is contained in:
parent
a7b830fedd
commit
5fee5aad38
79 changed files with 3943 additions and 274 deletions
|
@ -2,8 +2,8 @@
|
|||
#define KLIB_H__
|
||||
|
||||
#include <am.h>
|
||||
#include <stddef.h>
|
||||
#include <stdarg.h>
|
||||
#include <stddef.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
@ -12,43 +12,45 @@ extern "C" {
|
|||
//#define __NATIVE_USE_KLIB__
|
||||
|
||||
// string.h
|
||||
void *memset (void *s, int c, size_t n);
|
||||
void *memcpy (void *dst, const void *src, size_t n);
|
||||
void *memmove (void *dst, const void *src, size_t n);
|
||||
int memcmp (const void *s1, const void *s2, size_t n);
|
||||
size_t strlen (const char *s);
|
||||
char *strcat (char *dst, const char *src);
|
||||
char *strcpy (char *dst, const char *src);
|
||||
char *strncpy (char *dst, const char *src, size_t n);
|
||||
int strcmp (const char *s1, const char *s2);
|
||||
int strncmp (const char *s1, const char *s2, size_t n);
|
||||
char *stpcpy(char *dst, const char *src);
|
||||
char *stpncpy(char *dst, const char *src, size_t n);
|
||||
void *memset(void *s, int c, size_t n);
|
||||
void *memcpy(void *dst, const void *src, size_t n);
|
||||
void *memmove(void *dst, const void *src, size_t n);
|
||||
int memcmp(const void *s1, const void *s2, size_t n);
|
||||
size_t strlen(const char *s);
|
||||
char *strcat(char *dst, const char *src);
|
||||
char *strcpy(char *dst, const char *src);
|
||||
char *strncpy(char *dst, const char *src, size_t n);
|
||||
int strcmp(const char *s1, const char *s2);
|
||||
int strncmp(const char *s1, const char *s2, size_t n);
|
||||
|
||||
// stdlib.h
|
||||
void srand (unsigned int seed);
|
||||
int rand (void);
|
||||
void *malloc (size_t size);
|
||||
void free (void *ptr);
|
||||
int abs (int x);
|
||||
int atoi (const char *nptr);
|
||||
|
||||
//stdlib.h
|
||||
void srand(unsigned int seed);
|
||||
int rand(void);
|
||||
void *malloc(size_t size);
|
||||
void free(void *ptr);
|
||||
int abs(int x);
|
||||
int atoi(const char *nptr);
|
||||
// stdio.h
|
||||
int printf (const char *format, ...);
|
||||
int sprintf (char *str, const char *format, ...);
|
||||
int snprintf (char *str, size_t size, const char *format, ...);
|
||||
int vsprintf (char *str, const char *format, va_list ap);
|
||||
int vsnprintf (char *str, size_t size, const char *format, va_list ap);
|
||||
int printf(const char *format, ...);
|
||||
int sprintf(char *str, const char *format, ...);
|
||||
int snprintf(char *str, size_t size, const char *format, ...);
|
||||
int vsprintf(char *str, const char *format, va_list ap);
|
||||
int vsnprintf(char *str, size_t size, const char *format, va_list ap);
|
||||
|
||||
// assert.h
|
||||
#ifdef NDEBUG
|
||||
#define assert(ignore) ((void)0)
|
||||
#define assert(ignore) ((void)0)
|
||||
#else
|
||||
#define assert(cond) \
|
||||
do { \
|
||||
if (!(cond)) { \
|
||||
printf("Assertion fail at %s:%d\n", __FILE__, __LINE__); \
|
||||
halt(1); \
|
||||
} \
|
||||
} while (0)
|
||||
#define assert(cond) \
|
||||
do { \
|
||||
if (!(cond)) { \
|
||||
printf("Assertion fail at %s:%d\n", __FILE__, __LINE__); \
|
||||
halt(1); \
|
||||
} \
|
||||
} while (0)
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue