X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fpalacios%2Fvmm_string.c;h=7950934d8b91fb75971cf6e8baae121491cb8cba;hb=2cb41f7db5b9f89113432d6b3daff4807ba8e5f2;hp=af102f71c81e12121a2ef4c5ec77d36e3b5d3ac5;hpb=b7093fd3602ef2c796a1f8a0daded9d6aad0b756;p=palacios.git diff --git a/palacios/src/palacios/vmm_string.c b/palacios/src/palacios/vmm_string.c index af102f7..7950934 100644 --- a/palacios/src/palacios/vmm_string.c +++ b/palacios/src/palacios/vmm_string.c @@ -73,7 +73,7 @@ void * memmove(void * dst, const void * src, size_t n) { uint8_t * tmp = (uint8_t *)V3_Malloc(n); if (!tmp) { - PrintError("Cannot allocate in built-in memmove\n"); + PrintError(info->vm_info, info, "Cannot allocate in built-in memmove\n"); return NULL; } @@ -292,7 +292,7 @@ char * strdup(const char * s1) { ret = V3_Malloc(strlen(s1) + 1); if (!ret) { - PrintError("Cannot allocate in built-in strdup\n"); + PrintError(VM_NONE, VCORE_NONE, "Cannot allocate in built-in strdup\n"); return NULL; } @@ -320,6 +320,7 @@ int atoi(const char * buf) { #endif +#ifdef V3_CONFIG_BUILT_IN_STRTOI int strtoi(const char * nptr, char ** endptr) { int ret = 0; char * buf = (char *)nptr; @@ -337,7 +338,9 @@ int strtoi(const char * nptr, char ** endptr) { return ret; } +#endif +#ifdef V3_CONFIG_BUILT_IN_ATOX uint64_t atox(const char * buf) { uint64_t ret = 0; @@ -359,7 +362,9 @@ uint64_t atox(const char * buf) { return ret; } +#endif +#ifdef V3_CONFIG_BUILT_IN_STRTOX uint64_t strtox(const char * nptr, char ** endptr) { uint64_t ret = 0; char * buf = (char *)nptr; @@ -387,7 +392,7 @@ uint64_t strtox(const char * nptr, char ** endptr) { return ret; } - +#endif #ifdef V3_CONFIG_BUILT_IN_STRCHR @@ -505,7 +510,7 @@ char *strstr(const char *haystack, const char *needle) } #endif - +#ifdef V3_CONFIG_BUILT_IN_STR_TOLOWER void str_tolower(char * s) { while (isalpha(*s)) { if (!islower(*s)) { @@ -514,8 +519,9 @@ void str_tolower(char * s) { s++; } } +#endif - +#ifdef V3_CONFIG_BUILT_IN_STR_TOUPPER void str_toupper(char * s) { while (isalpha(*s)) { if (!isupper(*s)) { @@ -524,3 +530,4 @@ void str_toupper(char * s) { s++; } } +#endif