1 #ifndef PLATFORM_STDLIB_8721D_H 2 #define PLATFORM_STDLIB_8721D_H 3 4 #define CONFIG_PLATFORM_AMEBA_X 1 5 6 #if defined (__IARSTDLIB__) 7 #include <stdio.h> 8 #include <stdlib.h> 9 #include <string.h> 10 #include <stdint.h> 11 #include <stdarg.h> /* va_list */ 12 #include "diag.h" 13 14 #define strsep(str, delim) _strsep(str, delim) 15 #else 16 #include <stdio.h> 17 #include <stdlib.h> 18 #include <string.h> 19 #include <stdarg.h> /* va_list */ 20 #include "diag.h" 21 #include "strproc.h" 22 #include "memproc.h" 23 #include "basic_types.h" 24 #include "rtl8721d.h" 25 #include "rtl8721d_ram_libc.h" 26 #ifndef STD_PRINTF 27 #undef printf 28 #undef vsnprintf 29 #undef sprintf 30 #undef snprintf 31 #undef sscanf 32 #endif 33 #undef memchr 34 #undef memcmp 35 #undef memcpy 36 #undef memset 37 #undef memmove 38 #undef strcmp 39 #undef strcpy 40 #undef strlen 41 #undef strncmp 42 #undef strncpy 43 #undef strsep 44 #undef strtok 45 #undef strcat 46 #undef strchr 47 #undef strncat 48 #undef strstr 49 #undef atol 50 #undef atoi 51 #undef strpbrk 52 #undef strtoul 53 #undef strtol 54 #undef rand 55 #ifndef STD_PRINTF 56 #define printf _rtl_printf 57 #define sprintf _rtl_sprintf 58 #define snprintf _rtl_snprintf // NULL function 59 #define vsnprintf _rtl_vsnprintf 60 #define sscanf _rtl_sscanf //if use sscanf in std libc.a, please delete _strtol_r symbol in rlx8721d_rom_symbol_acut.ld 61 #endif 62 #define memchr _memchr 63 #define memcmp _memcmp 64 #define memcpy _memcpy //memcpy_gdma(dst, src, sz) 65 #define memmove _memmove 66 #define memset _memset 67 68 #define strchr(s, c) _strchr(s, c) // for B-cut ROM 69 #define strcmp(str1, str2) _strcmp(str1, str2) 70 #define strcpy _strcpy 71 #define strlen _strlen 72 #define strsep(str, delim) _strsep(str, delim) 73 #define strstr(str1, str2) _strstr(str1, str2) // NULL function 74 #define strtok(str, delim) _strtok(str, delim)//_strsep(str, delim) 75 #define strcat _strcat 76 77 #define strncmp(str1, str2, cnt) _strncmp(str1, str2, cnt) 78 #define strncpy(dest, src, count) _strncpy(dest, src, count) 79 #define strncat _strncat 80 81 #define strtoul(str, endp, base) _strtoul(str, endp, base) 82 #define strtol(str, endp, base) _strtol(str, endp, base) 83 84 #define atol(str) _strtol(str,NULL,10) 85 #define atoi(str) _stratoi(str) 86 #define strpbrk(cs, ct) _strpbrk(cs, ct) // for B-cut ROM 87 #define rand Rand 88 #define srand 89 90 //extern int _sscanf_patch(const char *buf, const char *fmt, ...); 91 //#define sscanf _sscanf_patch 92 93 94 #endif // defined (__IARSTDLIB__) 95 96 extern void *pvPortMalloc( size_t xWantedSize ); 97 extern void vPortFree( void *pv ); 98 #define malloc pvPortMalloc 99 #define free vPortFree 100 #define realloc pvPortReAlloc 101 #define calloc rtw_calloc 102 103 104 #endif // PLATFORM_STDLIB_8721D_H 105