Johannes Pfau wrote:
Hi,
I have a wrapper for a object aware c library (cairo). Take for
example two classes, Surface and a subclass, ImageSurface. Now this
code has to be valid:
---
auto ptr = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, 512, 512);
Surface s = new
From a discussion related to derelict:
How do you write this:
---
alias extern(C) int function(void* test) FTInitFunc;
FTInitFunc FT_Init_FreeType
---
without the alias?
On 7/12/2011 4:21 PM, Dainius (GreatEmerald) wrote:
I see. And what about Lua? I see lots and lots of different libraries
for that on dsource, and there is even some support in Derelict as
well. I assume that LuaD is the one in active development and most
fitting for current D2?
Derelict has
According to the Derelict page, there already are unofficial bindings.
But I guess they wouldn't work with Derelict2 anyway.
On 12/07/2011 11:36, Johannes Pfau wrote:
From a discussion related to derelict:
How do you write this:
---
alias extern(C) int function(void* test) FTInitFunc;
FTInitFunc FT_Init_FreeType
You should declare the function pointer without the extern(C).
Example:
alias int function(void* test) FTInitFunc;
extern(C) int foo(void* test){ }
FTInitFunc foo_ptr = foo;
This worked for me.
That's a bug.
On Mon, 11 Jul 2011 16:37:12 -0400, Andrej Mitrovic
andrej.mitrov...@gmail.com wrote:
import std.stdio;
import std.string;
void main()
{
char* foo = foo\0.dup.ptr;
writefln(Foo: %s, foo);
}
This will write the address of foo. Often when you link with C code
you have C structures
On Mon, 11 Jul 2011 18:08:19 -0400, Andrej Mitrovic
andrej.mitrov...@gmail.com wrote:
I'm trying to do something like the following:
import std.exception;
class Foo : Exception
{
this(string msg) { super(msg); }
}
class Bar : Exception
{
this(string msg) { super(msg); }
}
void
On Tue, 12 Jul 2011 05:36:15 -0400, Johannes Pfau s...@example.com wrote:
From a discussion related to derelict:
How do you write this:
---
alias extern(C) int function(void* test) FTInitFunc;
FTInitFunc FT_Init_FreeType
On Mon, 11 Jul 2011 16:46:07 -0400, Nick Sabalausky a@a.a wrote:
Steven Schveighoffer schvei...@yahoo.com wrote in message
Hm... I didn't know about that switch, I thought warnings were enabled
with -w and that made them errors.
I suppose you could stick this in there.
-wi: Enable
Is this a bug? If not, how do you make it work?
void h() {}
class Bla
{
mixin wrap!h;
}
mixin template wrap(alias f)
{
void blub(alias g = f)()
{
}
}
void main()
{
Bla b = new Bla();
b.blub();
}
test.d(18): Error: template instance cannot use
On Sat, 09 Jul 2011 05:47:51 -0400, Johannes Pfau s...@example.com wrote:
Hi,
I have a wrapper for a object aware c library (cairo). Take for
example two classes, Surface and a subclass, ImageSurface. Now this
code has to be valid:
---
auto ptr =
Steven Schveighoffer wrote:
On Sat, 09 Jul 2011 05:47:51 -0400, Johannes Pfau s...@example.com
wrote:
Hi,
I have a wrapper for a object aware c library (cairo). Take for
example two classes, Surface and a subclass, ImageSurface. Now this
code has to be valid:
---
auto
Firstly, thanks for response.
2011/7/11 Jesse Phillips jessekphillip...@gmail.com:
I'm sorry to say that I don't exactly know what you are trying to achieve or
problems you are having. I'm going to trying and provide details on what I
have gotten out of your message.
Hopefully i'll clarify
Steven Schveighoffer wrote:
On Tue, 12 Jul 2011 05:36:15 -0400, Johannes Pfau s...@example.com
wrote:
From a discussion related to derelict:
How do you write this:
---
alias extern(C) int function(void* test) FTInitFunc;
FTInitFunc
Trass3r wrote:
You should declare the function pointer without the extern(C).
Example:
alias int function(void* test) FTInitFunc;
extern(C) int foo(void* test){ }
FTInitFunc foo_ptr = foo;
This worked for me.
That's a bug.
I agree. It looks like the above code assigns a extern(C)
On Tue, 12 Jul 2011 09:42:22 -0400, Johannes Pfau s...@example.com wrote:
Steven Schveighoffer wrote:
On Tue, 12 Jul 2011 05:36:15 -0400, Johannes Pfau s...@example.com
wrote:
From a discussion related to derelict:
How do you write this:
On 12/07/2011 13:15, Trass3r wrote:
You should declare the function pointer without the extern(C).
Example:
alias int function(void* test) FTInitFunc;
extern(C) int foo(void* test){ }
FTInitFunc foo_ptr = foo;
This worked for me.
That's a bug.
Oh, well, I forgot to mention that the
On Tue, 12 Jul 2011 09:53:28 -0400, Steven Schveighoffer
schvei...@yahoo.com wrote:
But wait, don't normal D functions have C calling convention? I thought
that was one of the benefits of D's ABI?
Tested it out, definitely is different. So this clearly needs to be
addressed.
-Steve
Steven Schveighoffer Wrote:
Yes, but this is getting into territory where the false positive rate
might get high.
I bet it will be difficult to find a real-world example of this false positive.
On Tue, 12 Jul 2011 11:07:57 -0400, Kagamin s...@here.lot wrote:
Steven Schveighoffer Wrote:
Yes, but this is getting into territory where the false positive rate
might get high.
I bet it will be difficult to find a real-world example of this false
positive.
It depends on how the
shd Wrote:
Actually, project structure looks like that:
* project/
* bin/
* work/
* docs/
* iface/
* ae
* ge
* pe
(...)
* impl/
* glfw
* ge.window
* io.hid.keyboard
* io.hid.mouse
(you can add other window toolkits, or just
2011/7/12 Kagamin s...@here.lot:
You want an IOC container like Unity?
exactly
And you want the interface-to-class mapping to be configurable externally
rather than version out these classes directly in source?
like
version(UseGL)
{
static import wrappers.gl;
alias
Am 13.06.2011, 23:55 Uhr, schrieb Peter Alexander
peter.alexander...@gmail.com:
I'm trying to run the test suite for DMD, but I'm running into issues.
Do I need to set up my environment differently to run dmd in
development? How can I get around this?
To quote IRC:
In theory it's simple:
On 7/12/11, Steven Schveighoffer schvei...@yahoo.com wrote:
Call a function?
void main()
{
void handleEx(Exception e)
{
// exception handling code here
}
try
{
}
catch(Foo f)
{
handleEx(f);
}
catch(Bar b)
{
The problem you are experiencing comes from no dmd.conf being included
with the Git repository. Either you can add one to your Git clone
directory, or use your normal system-wide installation which probably
has all the paths set up correctly by specifying the DMD variable: »make
I think you may be confusing function templates with plain templates?
Yes, I was a bit confused by the syntax, but I found that type of
templates on page 281 in TDPL. That is an eponymous template.
Thanks.
Am 12.07.2011, 20:57 Uhr, schrieb David Nadlinger s...@klickverbot.at:
or use your normal system-wide installation which probably has all the
paths set up correctly by specifying the DMD variable: »make
DMD=/usr/local/bin/dmd«.
Thanks a lot for that hint!
i am just in the middle of my first little d project. i came to the point where
i have to start new processes command line style incl arguments. they need to
run independent of the main program, i.e., several such processes need to be
started and must run parallel while the main program
I just had a bug where a D function is implicitly converted to an
extern(C) function pointer.
I've had this definition:
alias extern (C) void function(void* userData) PaStreamFinishedCallback;
And this extern(C) function:
PaError Pa_SetStreamFinishedCallback(PaStream* stream,
Is this going to be fixed any time soon? Allowing callbacks with D
calling convention where a C callback is expected should be an error,
and this is like the 10th time I've ran into this bug.
http://d.puremagic.com/issues/show_bug.cgi?id=3797
On 7/12/11, Trass3r u...@known.com wrote:
Is this going to be fixed any time soon? Allowing callbacks with D
calling convention where a C callback is expected should be an error,
and this is like the 10th time I've ran into this bug.
http://d.puremagic.com/issues/show_bug.cgi?id=3797
Thanks,
Oh there's a pull already, this is great.
https://github.com/D-Programming-Language/dmd/pull/96
I'm wondering about this:
void main()
{
import std.math;
FloatingPointControl fpc;
fpc.enableExceptions(FloatingPointControl.severeExceptions);
float foo;
}
Declaring uninitialized floating point variables after enabling severe
exceptions will throw at runtime:
object.Error:
Andrej Mitrovic:
I don't know whether this is intentional or not,
I think it was not intentional. Regarding your successive questions, Don is
your man and best hope.
Bye,
bearophile
I think he's on a vacation though. :p
shd Wrote:
Firstly, thanks for response.
After reading Kagamin's response, I'm not sure I understand you still. You want
to have code reuse, you want to have run-time and compile-time configuration,
but you don't want to make use of the technologies/techniques/patterns which
facilitate
37 matches
Mail list logo