binary function interception

2010-03-28 Thread Trass3r
Just found that wonderful Detours package from Microsoft: http://research.microsoft.com/en-us/projects/detours/ Is there something like this for Linux, maybe even written in/available for D?

Re: -static and dmd

2010-03-28 Thread Jonathan M Davis
Mike Parker wrote: > Jonathan M Davis wrote: >> With gcc, you can pass it the -static flag and it will statically link >> everything. Normally, with dmd (on linux at least), it dynamically links >> all of the C/C++ libraries that it uses. So, if I run ldd (well, ldd32 >> technically) on one of my

Re: gc

2010-03-28 Thread Simen kjaeraas
sclytrack wrote: gc1thread1 thread2 thread3 gc2thread4 thread5 when the gc1 cycles it does not block the gc2 threads. Would that be of any use? Or possible. And only use communication like between two processes, some interprocess communication message passing t

Re: generic + numeric + literals = abomination

2010-03-28 Thread so
Why a generic code have to be ugly? At this age of compilers and languages, and the capabilities of DMD? Why that many casts? or implicit casts? DMD already doing it behind the scenes with constant folding, not sure but i think literals stay that way mostly because of C compatibility! Thanks.

Re: generic + numeric + literals = abomination

2010-03-28 Thread #ponce
so Wrote: > Basically what i am asking is hmmm, ability to write generic constants? :) > > Thanks! Hi, When writing generic FP code i always use real literals and cast to T, or int. I suggest doing this. Like: T exp3(T)(T x) { if (x < cast(T)(-1.15365L)) { retu

Re: generic + numeric + literals = abomination

2010-03-28 Thread so
I can't think of any solution they might provide sorry. You know there are C++ equivalents, for years and they didn't solve any problems above. Maybe i can use them to disable implicit casting, but then again program won't compile. :P Thanks! On Sun, 28 Mar 2010 18:09:21 +0400, biozic wrot

Re: generic + numeric + literals = abomination

2010-03-28 Thread biozic
Le 28/03/10 10:57, so a écrit : Well, i am having hard time explaining, it is not a surprise that you don't understand. To make things clearer, lets forget floats for a seconds and change your code to standard unsigned types. import std.stdio: writeln; struct Vector(T) { this(T m) { mm = m; }

Re: -static and dmd

2010-03-28 Thread Robert Clipsham
On 28/03/10 12:35, Robert Clipsham wrote: I don't think dmd offers a way to do this by default, your best bet would be to add -static to the makefile and see how it goes. I just saw Mike's reply, I notice I misread your question, sorry. I'd also try what he said, -L-static should do it.

Re: -static and dmd

2010-03-28 Thread Robert Clipsham
On 28/03/10 10:28, Jonathan M Davis wrote: With gcc, you can pass it the -static flag and it will statically link everything. Normally, with dmd (on linux at least), it dynamically links all of the C/C++ libraries that it uses. So, if I run ldd (well, ldd32 technically) on one of my programs I ge

Re: -static and dmd

2010-03-28 Thread Mike Parker
Jonathan M Davis wrote: With gcc, you can pass it the -static flag and it will statically link everything. Normally, with dmd (on linux at least), it dynamically links all of the C/C++ libraries that it uses. So, if I run ldd (well, ldd32 technically) on one of my programs I get: linu

Re: generic + numeric + literals = abomination

2010-03-28 Thread so
You didn't change anything there, just back to original code, now just enabled implicit cast again! Please read my next replies, everything should be clear now. :) Thanks! On Sun, 28 Mar 2010 14:32:21 +0400, bearophile wrote: so: Well, i am having hard time explaining, it is not a surp

Re: generic + numeric + literals = abomination

2010-03-28 Thread bearophile
so: > Well, i am having hard time explaining, it is not a surprise that you > don't understand. I think I have understood you this time. Writing skills are important for a programmer :-) Is this what you are asking for? But it's not very good code: import std.stdio: writeln; struct Vector(T)

Re: generic + numeric + literals = abomination

2010-03-28 Thread so
Everything comes to this... Why "3" is an int? Why "0.3 is a double? I guess these constraints was there before generic coding comes out, and we are just stuck with it! If these sound so naive, sorry about it, I don't know compiler/language history. Thanks! On Sun, 28 Mar 2010 12:29:17 +04

Re: generic + numeric + literals = abomination

2010-03-28 Thread so
Basically what i am asking is hmmm, ability to write generic constants? :) Thanks! On Sun, 28 Mar 2010 12:29:17 +0400, bearophile wrote: so: With one exception yes, i want all 3 test pass with your fix to implicit cast. You know, we are trying to write generic code. I don't understand

Re: generic + numeric + literals = abomination

2010-03-28 Thread so
Well, i am having hard time explaining, it is not a surprise that you don't understand. To make things clearer, lets forget floats for a seconds and change your code to standard unsigned types. import std.stdio: writeln; struct Vector(T) { this(T m) { mm = m; } Vector opBinary(strin

-static and dmd

2010-03-28 Thread Jonathan M Davis
With gcc, you can pass it the -static flag and it will statically link everything. Normally, with dmd (on linux at least), it dynamically links all of the C/C++ libraries that it uses. So, if I run ldd (well, ldd32 technically) on one of my programs I get: linux-gate.so.1 => (0xf779400

Re: generic + numeric + literals = abomination

2010-03-28 Thread bearophile
so: > With one exception yes, i want all 3 test pass with your fix to implicit > cast. > You know, we are trying to write generic code. I don't understand your problem/needs, sorry. Bye, bearophile