Changes for mingw to compile properly

This commit is contained in:
Kelly Wilson
2009-04-22 14:49:49 -06:00
parent 5c4455a394
commit d21cdb1df0
3 changed files with 16 additions and 10 deletions

View File

@@ -196,7 +196,7 @@ File* Module::buildFilePath(const char* forcename, const char* path, const char*
#if _WIN32
if (ext == global.params.objdir && FileName::ext(argobj)
&& stricmp(FileName::ext(argobj), global.obj_ext_alt) == 0)
return new File(argobj);
return new File((char*)argobj);
#endif
return new File(FileName::forceExt(argobj, ext));
}

View File

@@ -88,6 +88,12 @@ int REALALIGNSIZE = 2;
int Tsize_t = Tuns32;
int Tptrdiff_t = Tint32;
#if _WIN32
static double zero = 0;
double Port::nan = NAN;
double Port::infinity = 1/zero;
#endif
/***************************** Type *****************************/
ClassDeclaration *Type::typeinfo;

View File

@@ -579,9 +579,6 @@ char *FileName::name(const char *str)
switch (*e)
{
case '/':
return e + 1;
#if _WIN32
case '/':
case '\\':
@@ -594,6 +591,9 @@ char *FileName::name(const char *str)
*/
if (e == str + 1 || e == str + len - 1)
return e + 1;
#else
case '/':
return e + 1;
#endif
default:
if (e == str)
@@ -1672,12 +1672,7 @@ void OutBuffer::vprintf(const char *format, va_list args)
psize = sizeof(buffer);
for (;;)
{
#if _WIN32
count = _vsnprintf(p,psize,format,args);
if (count != -1)
break;
psize *= 2;
#elif POSIX
#if POSIX || IN_LLVM
va_list va;
va_copy(va, args);
/*
@@ -1697,6 +1692,11 @@ void OutBuffer::vprintf(const char *format, va_list args)
psize = count + 1;
else
break;
#elif _WIN32
count = _vsnprintf(p,psize,format,args);
if (count != -1)
break;
psize *= 2;
#endif
p = (char *) alloca(psize); // buffer too small, try again with larger size
}