Download Pelles C here: http://www.pellesc.se
/* internal stuff */
...
/* macro overrides */
#define atof(s) __stod(s,0,0)
[155]extern _CRTIMP double __cdecl __stod(const char *, char **, long);
[172]#define atof(s) __stod(s,0,0)
[177]#define strtod(s,endptr) __stod(s,endptr,0)
.
)
char *join(int ArgCount, PCTSTR Str1, ...)
{
va_list ap = {
0
};
PSTR BCX_RetStr = NULL;
PSTR currentStr = NULL;
int i;
size_t totalLen;
totalLen = strlen(Str1);
// Calc memory reqmnt
va_start(ap, Str1);
for(i=1; i<=ArgCount-1; i++)
{
currentStr = va_arg(ap,PSTR);
if(strlen(currentStr)>0) {
totalLen += (int)strlen(currentStr);
}
}
va_end(ap);
// Allocate memory
BCX_RetStr = BCX_TempStr(totalLen);
if(BCX_RetStr == 0) {
return NULL; // Not a good sign :-(
}
// Init result with Str1
strcpy(BCX_RetStr,Str1);
// Concat remainiing strings
va_start(ap, Str1);
for(i=1; i<=ArgCount-1; i++)
{
currentStr = va_arg(ap,PSTR);
if((int)strlen(currentStr)>0) {
strcat(BCX_RetStr,currentStr);
}
}
va_end(ap);
return BCX_RetStr;
}
Page created in 0.068 seconds with 15 queries.