Fix for mingw32 segfault

This commit is contained in:
Kelly Wilson
2009-05-23 14:59:04 -06:00
parent 1791d7b8b4
commit a178d9563d
4 changed files with 7 additions and 3 deletions

View File

@@ -1,4 +1,4 @@
#! /usr/bin/env bash
#! /usr/bin/env sh
# Default to 'ldc' next to this file
LDC=`basename "$0"`/ldc

View File

@@ -1668,7 +1668,7 @@ void OutBuffer::align(unsigned size)
// The compiler shipped with Visual Studio 2005 (and possible
// other versions) does not support C99 printf format specfiers
// such as %z and %j
#if _MSC_VER
#if _MSC_VER || __MINGW32__
using std::string;
using std::wstring;

View File

@@ -1739,7 +1739,11 @@ Statement *ForeachStatement::semantic(Scope *sc)
default: assert(0);
}
const char *r = (op == TOKforeach_reverse) ? "R" : "";
#ifdef __MINGW32__
int j = sprintf(fdname, "_aApply%s%.*s%lu", r, 2, fntab[flag], dim);
#else
int j = sprintf(fdname, "_aApply%s%.*s%zu", r, 2, fntab[flag], dim);
#endif
assert(j < sizeof(fdname));
//LDC: Build arguments.
Arguments* args = new Arguments;

View File

@@ -1613,7 +1613,7 @@ void OutBuffer::align(unsigned size)
// The compiler shipped with Visual Studio 2005 (and possible
// other versions) does not support C99 printf format specfiers
// such as %z and %j
#if _MSC_VER
#if _MSC_VER || __MINGW32__
using std::string;
using std::wstring;