# HG changeset patch # User Kelly Wilson # Date 1243112344 21600 # Node ID 17268b0a3ab07ec8a6449de28de4541ca001a54d # Parent bac3931b3de36ffc2044156c90ba64d422d642e0 Fix for mingw32 segfault diff -r bac3931b3de3 -r 17268b0a3ab0 bin/ldmd --- a/bin/ldmd Sat May 23 20:57:22 2009 +0200 +++ b/bin/ldmd Sat May 23 14:59:04 2009 -0600 @@ -1,4 +1,4 @@ -#! /usr/bin/env bash +#! /usr/bin/env sh # Default to 'ldc' next to this file LDC=`basename "$0"`/ldc diff -r bac3931b3de3 -r 17268b0a3ab0 dmd/root/root.c --- a/dmd/root/root.c Sat May 23 20:57:22 2009 +0200 +++ b/dmd/root/root.c Sat May 23 14:59:04 2009 -0600 @@ -1668,7 +1668,7 @@ // 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; diff -r bac3931b3de3 -r 17268b0a3ab0 dmd/statement.c --- a/dmd/statement.c Sat May 23 20:57:22 2009 +0200 +++ b/dmd/statement.c Sat May 23 14:59:04 2009 -0600 @@ -1739,7 +1739,11 @@ 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; diff -r bac3931b3de3 -r 17268b0a3ab0 dmd2/root.c --- a/dmd2/root.c Sat May 23 20:57:22 2009 +0200 +++ b/dmd2/root.c Sat May 23 14:59:04 2009 -0600 @@ -1613,7 +1613,7 @@ // 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;