From 55471a9330c1fb7bb808c0f597ae5299dc7de8fb Mon Sep 17 00:00:00 2001 From: Jack Stouffer Date: Wed, 11 Jan 2017 14:32:00 +0000 Subject: [PATCH 1/5] Revert "Qualify C-style memory allocations functions as pure" This reverts commit 65d9a071b244611ca3973d79c8e64388af5c5439. --- src/core/stdc/stdlib.d | 11 ++++++----- src/core/sys/posix/stdlib.d | 12 ++++++------ 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/core/stdc/stdlib.d b/src/core/stdc/stdlib.d index 6fe432aace..86cbafb5ed 100644 --- a/src/core/stdc/stdlib.d +++ b/src/core/stdc/stdlib.d @@ -157,11 +157,11 @@ else // functions using these already have to be @trusted, allowing them to // call @system stuff anyway. /// -void* malloc(size_t size) pure; +void* malloc(size_t size); /// -void* calloc(size_t nmemb, size_t size) pure; +void* calloc(size_t nmemb, size_t size); /// -void* realloc(void* ptr, size_t size) pure; +void* realloc(void* ptr, size_t size); /// void free(void* ptr); @@ -212,11 +212,11 @@ size_t wcstombs(char* s, in wchar_t* pwcs, size_t n); version( DigitalMars ) { // See malloc comment about @trusted. - void* alloca(size_t size) pure; // non-standard + void* alloca(size_t size); // non-standard } else version( GNU ) { - void* alloca(size_t size) pure; // compiler intrinsic + void* alloca(size_t size); // compiler intrinsic } version( CRuntime_Microsoft ) @@ -231,3 +231,4 @@ version( CRuntime_Microsoft ) /// long _wcstoi64(in wchar *,wchar **,int); } + diff --git a/src/core/sys/posix/stdlib.d b/src/core/sys/posix/stdlib.d index c9450a8412..4afd346d46 100644 --- a/src/core/sys/posix/stdlib.d +++ b/src/core/sys/posix/stdlib.d @@ -122,42 +122,42 @@ version( CRuntime_Glibc ) int setenv(in char*, in char*, int); int unsetenv(in char*); - void* valloc(size_t) pure; // LEGACY non-standard + void* valloc(size_t); // LEGACY non-standard } else version( Darwin ) { int setenv(in char*, in char*, int); int unsetenv(in char*); - void* valloc(size_t) pure; // LEGACY non-standard + void* valloc(size_t); // LEGACY non-standard } else version( FreeBSD ) { int setenv(in char*, in char*, int); int unsetenv(in char*); - void* valloc(size_t) pure; // LEGACY non-standard + void* valloc(size_t); // LEGACY non-standard } else version( OpenBSD ) { int setenv(in char*, in char*, int); int unsetenv(in char*); - void* valloc(size_t) pure; // LEGACY non-standard + void* valloc(size_t); // LEGACY non-standard } else version( CRuntime_Bionic ) { int setenv(in char*, in char*, int); int unsetenv(in char*); - void* valloc(size_t) pure; + void* valloc(size_t); } else version( Solaris ) { int setenv(in char*, in char*, int); int unsetenv(in char*); - void* valloc(size_t) pure; // LEGACY non-standard + void* valloc(size_t); // LEGACY non-standard } // From 64170f235abc33846f529c1907165ef8cd21d8e3 Mon Sep 17 00:00:00 2001 From: Jack Stouffer Date: Sat, 14 Jan 2017 16:24:42 -0500 Subject: [PATCH 2/5] Added pure back to alloca --- src/core/stdc/stdlib.d | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/core/stdc/stdlib.d b/src/core/stdc/stdlib.d index 86cbafb5ed..9348c7d107 100644 --- a/src/core/stdc/stdlib.d +++ b/src/core/stdc/stdlib.d @@ -212,11 +212,11 @@ size_t wcstombs(char* s, in wchar_t* pwcs, size_t n); version( DigitalMars ) { // See malloc comment about @trusted. - void* alloca(size_t size); // non-standard + void* alloca(size_t size) pure; // non-standard } else version( GNU ) { - void* alloca(size_t size); // compiler intrinsic + void* alloca(size_t size) pure; // compiler intrinsic } version( CRuntime_Microsoft ) @@ -231,4 +231,3 @@ version( CRuntime_Microsoft ) /// long _wcstoi64(in wchar *,wchar **,int); } - From 3bdd684d5664573ec95fdea3366f561bdd5f2de5 Mon Sep 17 00:00:00 2001 From: Rainer Schuetze Date: Sun, 6 Nov 2016 10:52:02 +0100 Subject: [PATCH 3/5] do not enforce specific MS C runtime --- src/rt/monitor_.d | 5 ----- win64.mak | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/rt/monitor_.d b/src/rt/monitor_.d index f73e32137b..be0672e255 100644 --- a/src/rt/monitor_.d +++ b/src/rt/monitor_.d @@ -155,11 +155,6 @@ version (Windows) { pragma(lib, "snn.lib"); } - else version (CRuntime_Microsoft) - { - pragma(lib, "libcmt.lib"); - pragma(lib, "oldnames.lib"); - } import core.sys.windows.windows; alias Mutex = CRITICAL_SECTION; diff --git a/win64.mak b/win64.mak index fea4d5d475..95e141144a 100644 --- a/win64.mak +++ b/win64.mak @@ -22,7 +22,7 @@ UDFLAGS=-m$(MODEL) -conf= -O -release -dip25 -w -Isrc -Iimport DDOCFLAGS=-conf= -c -w -o- -Isrc -Iimport -version=CoreDdoc #CFLAGS=/O2 /I"$(VCDIR)"\INCLUDE /I"$(SDKDIR)"\Include -CFLAGS=/Z7 /I"$(VCDIR)"\INCLUDE /I"$(SDKDIR)"\Include +CFLAGS=/Z7 /Zl /I"$(VCDIR)"\INCLUDE /I"$(SDKDIR)"\Include DRUNTIME_BASE=druntime$(MODEL) DRUNTIME=lib\$(DRUNTIME_BASE).lib From 3251f097606d4b34a6b9716d8525d3fd03a0fd93 Mon Sep 17 00:00:00 2001 From: Rainer Schuetze Date: Wed, 9 Nov 2016 22:32:15 +0100 Subject: [PATCH 4/5] move new switch into separate line to not cause merge conflict with the auto tester --- win64.mak | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/win64.mak b/win64.mak index 95e141144a..89f28a4941 100644 --- a/win64.mak +++ b/win64.mak @@ -22,12 +22,15 @@ UDFLAGS=-m$(MODEL) -conf= -O -release -dip25 -w -Isrc -Iimport DDOCFLAGS=-conf= -c -w -o- -Isrc -Iimport -version=CoreDdoc #CFLAGS=/O2 /I"$(VCDIR)"\INCLUDE /I"$(SDKDIR)"\Include -CFLAGS=/Z7 /Zl /I"$(VCDIR)"\INCLUDE /I"$(SDKDIR)"\Include +CFLAGS=/Z7 /I"$(VCDIR)"\INCLUDE /I"$(SDKDIR)"\Include DRUNTIME_BASE=druntime$(MODEL) DRUNTIME=lib\$(DRUNTIME_BASE).lib GCSTUB=lib\gcstub$(MODEL).obj +# do not preselect a C runtime (extracted from the line above to make the auto tester happy) +CFLAGS=$(CFLAGS) /Zl + DOCFMT= target : import copydir copy $(DRUNTIME) $(GCSTUB) From afbadc1982c240d8e7bdb2c03411c6de2ef90ca3 Mon Sep 17 00:00:00 2001 From: Dicebot Date: Mon, 16 Jan 2017 13:03:56 +0000 Subject: [PATCH 5/5] Add missing const to iconv bindings --- src/core/sys/posix/iconv.d | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/sys/posix/iconv.d b/src/core/sys/posix/iconv.d index 816f64632b..792778cd6e 100644 --- a/src/core/sys/posix/iconv.d +++ b/src/core/sys/posix/iconv.d @@ -35,7 +35,7 @@ iconv_t iconv_open (in char* tocode, in char* fromcode); /// Convert at most *INBYTESLEFT bytes from *INBUF according to the /// code conversion algorithm specified by CD and place up to /// *OUTBYTESLEFT bytes in buffer at *OUTBUF. -size_t iconv (iconv_t cd, char** inbuf, +size_t iconv (iconv_t cd, in char** inbuf, size_t* inbytesleft, char** outbuf, size_t* outbytesleft);