On 7/18/2011 11:52 PM, Andrej Mitrovic wrote:
See I tried using dumpbin, but apparently I wiped it from my PATH so I
had to rely on DLL Export viewer (because I'm lazy and it had an icon
on my desktop!) which doesn't even show this. I had a hunch that was
happening behind the scenes. Thanks for t
Uhh, I tried using ASM to simulate the thiscall calling convention, it
didn't go all to well. :) A wrapper C++ DLL that exposes a C interface
was my workaround.
Here's a page that talks about some problems with passing objects via DLLs:
http://www.prowiki.org/wiki4d/wiki.cgi?BestPractices/DLL
On 7/19/11, Johann MacDonagh wrote:
> If you export it like this, it will be exported as the C++ mangled name.
> If you have extern(C) it will be cdecl "_SetInt" and extern(Windows)
> will be stdcall "_SetInt@4".
Right, that's all pretty standard stuff. :)
>
>> I don't know why, but if you use a
On 7/18/2011 11:27 PM, Loopback wrote:
On 2011-07-19 04:40, Andrej Mitrovic wrote:
You have several problems.
extern(C++) only specifies the calling convention, not the visibility
of the symbol. To export the symbol, list it in a .def file or mark
the function with export in the module itself,
On 2011-07-19 04:40, Andrej Mitrovic wrote:
You have several problems.
extern(C++) only specifies the calling convention, not the visibility
of the symbol. To export the symbol, list it in a .def file or mark
the function with export in the module itself, ala:
export extern(C++) void SetInt(int
On 7/18/2011 10:40 PM, Andrej Mitrovic wrote:
You have several problems.
extern(C++) only specifies the calling convention, not the visibility
of the symbol. To export the symbol, list it in a .def file or mark
the function with export in the module itself, ala:
export extern(C++) void SetInt(i
You have several problems.
extern(C++) only specifies the calling convention, not the visibility
of the symbol. To export the symbol, list it in a .def file or mark
the function with export in the module itself, ala:
export extern(C++) void SetInt(int * foo) {}
I don't know why, but if you use a
On 2011-07-19 00:56, Johann MacDonagh wrote:
On 7/18/2011 5:04 PM, Andrej Mitrovic wrote:
On 7/18/11, Loopback wrote:
On 2011-07-18 21:59, Andrej Mitrovic wrote:
import core.dll_helper; is outdated, use import core.sys.windows.dll;
And also import core.runtime;
Are there any examples coverin
On 7/18/2011 7:43 PM, Jonathan M Davis wrote:
On 2011-07-18 16:02, Johann MacDonagh wrote:
On 7/18/2011 7:00 PM, bearophile wrote:
Jonathan M Davis:
And if pure were inferred for a function and then it became
impure, that could break a _lot_ of code.
OK. The restricted idea then is to infer
On Tuesday 19 July 2011 01:19:11 Jesse Phillips wrote:
> On Mon, 18 Jul 2011 19:44:38 +0200, David Nadlinger wrote:
> > On 7/18/11 7:43 PM, Jesse Phillips wrote:
> >> I'm wondering if this should be filed in Bugzilla. I'm guessing it
> >> should. The blow should compile?
> >>
> >> void main() {
>
On Mon, 18 Jul 2011 19:44:38 +0200, David Nadlinger wrote:
> On 7/18/11 7:43 PM, Jesse Phillips wrote:
>> I'm wondering if this should be filed in Bugzilla. I'm guessing it
>> should. The blow should compile?
>>
>> void main() {
>> example(null);
>> }
>>
>> void example()(string[] foo) {
>> }
On 2011-07-18 16:02, Johann MacDonagh wrote:
> On 7/18/2011 7:00 PM, bearophile wrote:
> > Jonathan M Davis:
> >> And if pure were inferred for a function and then it became
> >> impure, that could break a _lot_ of code.
> >
> > OK. The restricted idea then is to infer only the purity of functions
On 2011-07-18 16:07, bearophile wrote:
> > Example: if a not pure function sqr is called by both a not pure template
> > bar and by a pure function foo, the compiler raises an error in foo,
> > because sqr is not pure, but compiles the pure main because sqr called
> > by bar is seen as pure :-)
>
On 7/18/2011 7:08 PM, Andrej Mitrovic wrote:
On 7/19/11, Johann MacDonagh wrote:
FWIW I was able to compile and link a D DLL with the code I copy pasted
in the other message.
Maybe you're running 2.052. I think in 2.053 dll_helper disappeared,
and so in 2.054:
D:\dev\code\d_code\DLLTest>dmd
On 7/19/11, Johann MacDonagh wrote:
> FWIW I was able to compile and link a D DLL with the code I copy pasted
> in the other message.
Maybe you're running 2.052. I think in 2.053 dll_helper disappeared,
and so in 2.054:
D:\dev\code\d_code\DLLTest>dmd mydll.d
mydll.d(9): Error: module dll_helper
On 7/18/2011 7:00 PM, bearophile wrote:
Jonathan M Davis:
And if pure were inferred for a function and then it became
impure, that could break a _lot_ of code.
OK. The restricted idea then is to infer only the purity of functions called by
templates, to allow more templates to be pure, and s
> Example: if a not pure function sqr is called by both a not pure template bar
> and by a pure function foo, the compiler raises an error in foo, because sqr
> is not pure, but compiles the pure main because sqr called by bar is seen as
> pure :-)
This seems quite useful for delegates given to
On 7/18/2011 5:04 PM, Andrej Mitrovic wrote:
On 7/18/11, Loopback wrote:
On 2011-07-18 21:59, Andrej Mitrovic wrote:
import core.dll_helper; is outdated, use import core.sys.windows.dll;
And also import core.runtime;
Are there any examples covering these new modules, or are the procedure
the
Jonathan M Davis:
> And if pure were inferred for a function and then it became
> impure, that could break a _lot_ of code.
OK. The restricted idea then is to infer only the purity of functions called by
templates, to allow more templates to be pure, and such inferred purity is seen
by functio
On 2011-07-18 15:15, teo wrote:
> On Mon, 18 Jul 2011 18:14:45 +, Jonathan M Davis wrote:
> > On 2011-07-18 10:54, Simen Kjaeraas wrote:
> >> On Mon, 18 Jul 2011 18:06:46 +0200, Jonathan M Davis
> >>
> >>
> >> wrote:
> >> > On Monday 18 July 2011 15:55:52 teo wrote:
> >> >> On Mon, 18 Jul 201
On Mon, 18 Jul 2011 18:14:45 +, Jonathan M Davis wrote:
> On 2011-07-18 10:54, Simen Kjaeraas wrote:
>> On Mon, 18 Jul 2011 18:06:46 +0200, Jonathan M Davis
>>
>>
>> wrote:
>> > On Monday 18 July 2011 15:55:52 teo wrote:
>> >> On Mon, 18 Jul 2011 10:26:27 -0400, Steven Schveighoffer wrote:
>
On 2011-07-18 14:01, Steven Schveighoffer wrote:
> On Mon, 18 Jul 2011 16:52:41 -0400, Jonathan M Davis
>
> wrote:
> > On 2011-07-18 13:32, Steven Schveighoffer wrote:
> >> On Mon, 18 Jul 2011 16:01:08 -0400, bearophile
> >>
> >>
> >> wrote:
> >> > Maybe someone has already answered this questi
On 7/18/11, Loopback wrote:
> On 2011-07-18 21:59, Andrej Mitrovic wrote:
>> import core.dll_helper; is outdated, use import core.sys.windows.dll;
>> And also import core.runtime;
>
> Are there any examples covering these new modules, or are the procedure
> the same?
>
It's all pretty much the sa
On Mon, 18 Jul 2011 16:52:41 -0400, Jonathan M Davis
wrote:
On 2011-07-18 13:32, Steven Schveighoffer wrote:
On Mon, 18 Jul 2011 16:01:08 -0400, bearophile
wrote:
> Maybe someone has already answered this question, but I don't remember
> it.
>
> DMD 2.054 is able to infer if a template f
On 2011-07-18 13:32, Steven Schveighoffer wrote:
> On Mon, 18 Jul 2011 16:01:08 -0400, bearophile
>
> wrote:
> > Maybe someone has already answered this question, but I don't remember
> > it.
> >
> > DMD 2.054 is able to infer if a template function is pure. Isn't it a
> > good idea to use the s
On Mon, 18 Jul 2011 16:01:08 -0400, bearophile
wrote:
Maybe someone has already answered this question, but I don't remember
it.
DMD 2.054 is able to infer if a template function is pure. Isn't it a
good idea to use the same machinery to infer the unmarked functions too?
A template may
On 2011-07-18 21:59, Andrej Mitrovic wrote:
import core.dll_helper; is outdated, use import core.sys.windows.dll;
And also import core.runtime;
Are there any examples covering these new modules, or are the procedure
the same?
In DMD 2.054 if I have a wrong program like this, a function that's not pure
called from a pure function:
import std.conv;
void main() pure {
to!int("12");
}
DMD 2.054 prints:
test.d(3): Error: pure function 'main' cannot call impure function 'to'
Instead of that error message, do you lik
Maybe someone has already answered this question, but I don't remember it.
DMD 2.054 is able to infer if a template function is pure. Isn't it a good idea
to use the same machinery to infer the unmarked functions too? A template may
call a second function that's not annotated with 'pure' despite
import core.dll_helper; is outdated, use import core.sys.windows.dll;
And also import core.runtime;
On 2011-07-17 22:51, Johann MacDonagh wrote:
On 7/17/2011 3:53 PM, Loopback wrote:
On 2011-07-17 21:45, Loopback wrote:
Hello!
As of my understanding you can write usable c libraries in D by using
extern(C). The problem is that I haven't found any other threads asking
the same question about C
On 2011-07-18 10:54, Simen Kjaeraas wrote:
> On Mon, 18 Jul 2011 18:06:46 +0200, Jonathan M Davis
>
> wrote:
> > On Monday 18 July 2011 15:55:52 teo wrote:
> >> On Mon, 18 Jul 2011 10:26:27 -0400, Steven Schveighoffer wrote:
> >> > On Sun, 17 Jul 2011 15:29:02 -0400, teo wrote:
> >> >> It looks
On 2011-07-18 10:44, David Nadlinger wrote:
> On 7/18/11 7:43 PM, Jesse Phillips wrote:
> > I'm wondering if this should be filed in Bugzilla. I'm guessing it
> > should. The blow should compile?
> >
> > void main() {
> >
> > example(null);
> >
> > }
> >
> > void example()(string[] foo) {
> > }
On Mon, 18 Jul 2011 18:06:46 +0200, Jonathan M Davis
wrote:
On Monday 18 July 2011 15:55:52 teo wrote:
On Mon, 18 Jul 2011 10:26:27 -0400, Steven Schveighoffer wrote:
> On Sun, 17 Jul 2011 15:29:02 -0400, teo wrote:
>> It looks like std.concurrency.spawn does not accept delegates. Is
>> the
float[] buffers = malloc..;
float*[] CBuffers = buffers[].ptr;
Pure win.
On 7/18/11 7:43 PM, Jesse Phillips wrote:
I'm wondering if this should be filed in Bugzilla. I'm guessing it should. The
blow should compile?
void main() {
example(null);
}
void example()(string[] foo) {
}
test.d(3): Error: template test.example() does not match any function template
I'm wondering if this should be filed in Bugzilla. I'm guessing it should. The
blow should compile?
void main() {
example(null);
}
void example()(string[] foo) {
}
test.d(3): Error: template test.example() does not match any function template
declaration
test.d(3): Error: template test
On 7/18/11 6:28 PM, McAnany, Charles E wrote:
Hi, all. I'm trying to sort an array of BigInts, and I get an overlapping array
copy error. Short of writing my own sorting algorithm, is there a workaround
for this?
Didn't you ask the same question here a few days ago? In any case, here
is the
Hi, all. I'm trying to sort an array of BigInts, and I get an overlapping array
copy error. Short of writing my own sorting algorithm, is there a workaround
for this?
Thanks,
Charles.
Thank you, it works as planned, now as:
int mo = Now.month; // --> 7
== Repost the article of Jonathan M Davis (jmdavisp...@gmx.com)
== Posted at 2011/07/18 12:14 to digitalmars.D.learn
On�Monday�18�July�2011�16:01:06�dsmith�wrote:
>�Recall�that�std.date�used�the�following�to�retrieve�a�month�in
On Monday 18 July 2011 16:01:06 dsmith wrote:
> Recall that std.date used the following to retrieve a month in integer form
> (0 .. 11):
>
> auto Now = std.date.getUTCtime();
> writeln(std.date.monthFromTime(Now));
>
> Using std.datetime, the following yields the abbreviated month name:
>
>
On Monday 18 July 2011 14:11:29 Magnus Lie Hetland wrote:
> Is it intended that local functions can't be polymorphic?
>
> Example:
>
> void foo(int x) {}
> void foo(string x) {}
>
> void bar() {
> void foo(int x) {}
> void foo(string x) {}
> }
>
> void main() {
> }
>
> The error (at li
On Monday 18 July 2011 15:55:52 teo wrote:
> On Mon, 18 Jul 2011 10:26:27 -0400, Steven Schveighoffer wrote:
> > On Sun, 17 Jul 2011 15:29:02 -0400, teo wrote:
> >> It looks like std.concurrency.spawn does not accept delegates. Is
> >> there
> >> any reason for that?
> >
> > There is no type atta
Recall that std.date used the following to retrieve a month in integer form (0
.. 11):
auto Now = std.date.getUTCtime();
writeln(std.date.monthFromTime(Now));
Using std.datetime, the following yields the abbreviated month name:
auto Now = Clock.currTime();
writefln("%s", Now.month);
On Mon, 18 Jul 2011 10:26:27 -0400, Steven Schveighoffer wrote:
> On Sun, 17 Jul 2011 15:29:02 -0400, teo wrote:
>
>> It looks like std.concurrency.spawn does not accept delegates. Is there
>> any reason for that?
>
> There is no type attached to the hidden 'this' pointer. So spawn cannot
> gu
On Sun, 17 Jul 2011 15:29:02 -0400, teo wrote:
It looks like std.concurrency.spawn does not accept delegates. Is there
any reason for that?
There is no type attached to the hidden 'this' pointer. So spawn cannot
guarantee it doesn't point to unshared data.
-Steve
Is it intended that local functions can't be polymorphic?
Example:
void foo(int x) {}
void foo(string x) {}
void bar() {
void foo(int x) {}
void foo(string x) {}
}
void main() {
}
The error (at line 6) is "declaration foo is already defined".
The code compiles if you comment out at lea
Wilfried Kirschenmann:
> In fact, I would be more interested in the opposite :
If you allow that syntax on the left you probably allow it on the right too.
Bye,
bearophile
48 matches
Mail list logo