mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-11 18:33:14 +01:00
Fix for mingw32 segfault
This commit is contained in:
2
bin/ldmd
2
bin/ldmd
@@ -1,4 +1,4 @@
|
||||
#! /usr/bin/env bash
|
||||
#! /usr/bin/env sh
|
||||
|
||||
# Default to 'ldc' next to this file
|
||||
LDC=`basename "$0"`/ldc
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user