Re: erro when use core.runtime

2017-05-17 Thread Dsby via Digitalmars-d-learn
I am in openSUSE. I see the code in runtime. it is only support Windows in default. in posix only version (Shared) is will build. why?

Re: erro when use core.runtime

2017-05-17 Thread Dsby via Digitalmars-d-learn
On Thursday, 18 May 2017 at 04:53:36 UTC, Dsby wrote: Linking... ../../.dub/build/library-debug-linux.posix-x86_64-dmd_2073-368A963AFD76168526BD99BBB313FD4B/libyu.a(runtime_a21_4e7.o):在函数‘_D4core7runtime7Runtime17__T11loadLibraryZ11loadLibraryFxAaZPv ’中:

erro when use core.runtime

2017-05-17 Thread Dsby via Digitalmars-d-learn
Linking... ../../.dub/build/library-debug-linux.posix-x86_64-dmd_2073-368A963AFD76168526BD99BBB313FD4B/libyu.a(runtime_a21_4e7.o):在函数‘_D4core7runtime7Runtime17__T11loadLibraryZ11loadLibraryFxAaZPv ’中: /usr/include/dmd/druntime/import/core/runtime.d:222:对‘rt_loadLibrary’未定义的引用

Re: Atomicity of file-copying/moving

2017-05-17 Thread Nordlöw via Digitalmars-d-learn
On Wednesday, 17 May 2017 at 20:02:44 UTC, Per Nordlöw wrote: The standard way is to copy the source to a temporary file on the same file system as the target file followed by hardlinking Correction: should be renaming. Here's an implementation in Python (3):

Re: Atomicity of file-copying/moving

2017-05-17 Thread H. S. Teoh via Digitalmars-d-learn
On Wed, May 17, 2017 at 07:56:52PM +, Per Nordlöw via Digitalmars-d-learn wrote: > On Tuesday, 16 May 2017 at 10:57:08 UTC, FreeSlave wrote: > > > > Not sure about renaming but copying is not atomic on Posix because > > it does not handle interruption by signal. I opened issue about that > >

Re: Atomicity of file-copying/moving

2017-05-17 Thread Per Nordlöw via Digitalmars-d-learn
On Wednesday, 17 May 2017 at 19:56:52 UTC, Per Nordlöw wrote: On Tuesday, 16 May 2017 at 10:57:08 UTC, FreeSlave wrote: Not sure about renaming but copying is not atomic on Posix because it does not handle interruption by signal. I opened issue about that

Re: Atomicity of file-copying/moving

2017-05-17 Thread Per Nordlöw via Digitalmars-d-learn
On Tuesday, 16 May 2017 at 10:57:08 UTC, FreeSlave wrote: Not sure about renaming but copying is not atomic on Posix because it does not handle interruption by signal. I opened issue about that https://issues.dlang.org/show_bug.cgi?id=17296 The standard way is to copy the source to a

Re: How to setup DLL and EXE projects in one VS solution

2017-05-17 Thread Igor via Digitalmars-d-learn
On Wednesday, 17 May 2017 at 18:03:04 UTC, Igor wrote: What exactly do mean by "binding"? If I understand the rest you are saying that I could just use "Add existing item" to add the dllproj.d file to EXEProject as well, but that would cause all of the code from it to be linked in the EXE

Re: avoid extra variable during void pointer cast

2017-05-17 Thread Marco Leise via Digitalmars-d-learn
Am Mon, 15 May 2017 19:30:00 + schrieb Bauss : > pragma(inline, true); doesn't actually do what you think it does. > In lining is always done whenever possible and that only tells > the compiler to spit out an error if it can't inline it. A compiler doesn't simply inline

Re: Atomicity of file-copying/moving

2017-05-17 Thread Jerry via Digitalmars-d-learn
On Tuesday, 16 May 2017 at 08:32:56 UTC, Nordlöw wrote: What's the status of atomicity of file-copying and -moving (renaming) using std.file on different platforms? Niall has a good talk about this on youtube: https://www.youtube.com/watch?v=uhRWMGBjlO8

Re: How to setup DLL and EXE projects in one VS solution

2017-05-17 Thread Igor via Digitalmars-d-learn
On Wednesday, 17 May 2017 at 17:48:50 UTC, solidstate1991 wrote: I think you should make a binding for your DLL file. On the other hand I successfully set up a static library and an application in the same solution (now it has 2 apps, one is my map editor and file converter, the other is a

Re: How to setup DLL and EXE projects in one VS solution

2017-05-17 Thread solidstate1991 via Digitalmars-d-learn
On Wednesday, 17 May 2017 at 16:56:13 UTC, Igor wrote: At the moment I have: EXEProject: app.d - it does loadlibrary of dllproj and uses data structures defined in dllproj.d (it imports dllproj). On the file system this file is under /platform/win32/ and is defined as module win32.app;

How to setup DLL and EXE projects in one VS solution

2017-05-17 Thread Igor via Digitalmars-d-learn
At the moment I have: EXEProject: app.d - it does loadlibrary of dllproj and uses data structures defined in dllproj.d (it imports dllproj). On the file system this file is under /platform/win32/ and is defined as module win32.app; DLLProject dllproj.d - exports functions and contains

Re: Current LDC Android status

2017-05-17 Thread Igor via Digitalmars-d-learn
On Tuesday, 16 May 2017 at 03:00:08 UTC, Mike B Johnson wrote: So what is currently the state of affairs with LDC and android? Last time I remember, it *could* compile to android but barely. About a month ago I tried to build OpenGL sample app following directions from here:

Re: function overload with mixin template bug?

2017-05-17 Thread Patric Dexheimer via Digitalmars-d-learn
On Wednesday, 17 May 2017 at 13:26:36 UTC, Adam D. Ruppe wrote: On Wednesday, 17 May 2017 at 13:13:06 UTC, Patric Dexheimer wrote: Function overloads coming from mixin templates are not being detected ? A name being present in the struct means that name is NOT pulled from the mixin template.

Re: No tempFile() in std.file

2017-05-17 Thread Jonathan M Davis via Digitalmars-d-learn
On Wednesday, May 17, 2017 05:34:50 Patrick Schluter via Digitalmars-d-learn wrote: > On Wednesday, 17 May 2017 at 05:30:40 UTC, Patrick Schluter wrote: > > On Tuesday, 16 May 2017 at 13:56:57 UTC, Jonathan M Davis wrote: > >> [...] > > > > As your solution doesn't inherently solve the race

Re: function overload with mixin template bug?

2017-05-17 Thread Adam D. Ruppe via Digitalmars-d-learn
On Wednesday, 17 May 2017 at 13:13:06 UTC, Patric Dexheimer wrote: Function overloads coming from mixin templates are not being detected ? A name being present in the struct means that name is NOT pulled from the mixin template. This is a feature, not a bug. It allows overriding of mixin

Re: Atomicity of file-copying/moving

2017-05-17 Thread Andrew Godfrey via Digitalmars-d-learn
On Tuesday, 16 May 2017 at 08:32:56 UTC, Nordlöw wrote: What's the status of atomicity of file-copying and -moving (renaming) using std.file on different platforms? For renaming that's a good question, but for copying, no-one should make atomicity guarantees. It's inherently non-atomic, and

function overload with mixin template bug?

2017-05-17 Thread Patric Dexheimer via Digitalmars-d-learn
1) struct T{ void f1(){writeln("default f1");} void f1(int x){writeln("overload f1");} } //main T().f1(); T().f1(1); //compiles and output as expected. 2) mixin template add_function(){ void f1(){writeln("default f1");} } struct T{ mixin add_function; void f1(int

Re: D equivalent of C++11's function local static initialization?

2017-05-17 Thread via Digitalmars-d-learn
On Wednesday, 17 May 2017 at 03:08:39 UTC, Timothee Cour wrote: NOTE: curious about both cases: * thread local * shared On Tue, May 16, 2017 at 8:04 PM, Timothee Cour wrote: what's the best D equivalent of C++11's function local static initialization? ``` void

Re: D equivalent of C++11's function local static initialization?

2017-05-17 Thread Ola Fosheim Grøstad via Digitalmars-d-learn
On Wednesday, 17 May 2017 at 07:08:07 UTC, bauss wrote: On Wednesday, 17 May 2017 at 03:08:39 UTC, Timothee Cour wrote: NOTE: curious about both cases: * thread local * shared On Tue, May 16, 2017 at 8:04 PM, Timothee Cour wrote: what's the best D equivalent of

Re: D equivalent of C++11's function local static initialization?

2017-05-17 Thread bauss via Digitalmars-d-learn
On Wednesday, 17 May 2017 at 03:08:39 UTC, Timothee Cour wrote: NOTE: curious about both cases: * thread local * shared On Tue, May 16, 2017 at 8:04 PM, Timothee Cour wrote: what's the best D equivalent of C++11's function local static initialization? ``` void