On Tue, 15 Dec 2009 00:56:12 -0500, Phil Deets wrote:
(D 2.033) I'm porting a DLL to D. The DLL depends on a static library,
but when I put the library name on the command-line, dmd does not output
any DLL file. If I remove the library name from the command-line, dmd
gives linker errors an
(D 2.033) I'm porting a DLL to D. The DLL depends on a static library, but
when I put the library name on the command-line, dmd does not output any
DLL file. If I remove the library name from the command-line, dmd gives
linker errors and outputs an invalid DLL. How do I make a DLL with a
st
Zarathustra wrote:
Thanks Simen. I hoped D will be bugless and static if will be possible
inside enums.
Static if will probably never be usable inside enums. The best way to
get something like it - at least currently - is to use string mixins
and/or the defineEnum template in std.typecons.
Simen kjaeraas Wrote:
> Looks to me like a forward reference problem. Sadly, there
> still are some of those in the language.
>
> Yes. http://www.digitalmars.com/d/2.0/faq.html#anonymous
>
>
> struct Foo
> {
> union { int a; int b; } // I HAZ NO NAYM
> struct { int c; int d; } // I
On Mon, 14 Dec 2009 15:43:49 +0100, Zarathustra
wrote:
I must to put a 'struct definition' inside a 'static if block' but other
'struct definition' doesn't see them.
static if(_WIN32IE !< 0x0400)
struct TVINSERTSTRUCT{
HTREEITEM hparent ;
HTREEITEM hinsertafter;
union tagDUMMYU
BCS:
> Just a guess: D is correctly using double and C is assuming float? Try
> running
> it with d1 as a float to check.
I have run the code again with the last D1 compiler, and now writeln is giving
the same result as printf. So probably it was a writefln bug that's already
fixed.
Sorry for
Gareth Charnock Wrote:
> And now I see there was an article about that on website all
> along.
And that article is here:
http://www.digitalmars.com/d/2.0/migrate-to-shared.html
Ali
Hello bearophile,
Do you know what's causing the difference in the outouts?
void main() {
double d1 = 3.14159;
printf("%a\n", d1);
writefln("%a\n", d1);
}
Outputs:
0x1.921f9f01b866ep+1
0xc.90fcf80dc337p-2
A printf in C code compiled with GCC prints the same as the printf
here.
Bye,
bearophile
Thanks, I filed this bug for the .idup issue:
http://d.puremagic.com/issues/show_bug.cgi?id=3615
Do you know what's causing the difference in the outouts?
void main() {
double d1 = 3.14159;
printf("%a\n", d1);
writefln("%a\n", d1);
}
Outputs:
0x1.921f9f01b866ep+1
0xc.90fcf80dc337p-2
A printf in C code compiled with GCC prints the same as the printf here.
Bye,
bearophile
Matthew:
A cleaned up case:
struct B { A a; }
static if(true)
struct A {}
void main() {}
I think this may be a forward reference bug.
Bye,
bearophile
Don Wrote:
> Does that compile??? It shouldn't. !< is a floating-point operator.
Of course that compile (thanks Got DMD behaviors logically). In this case !<
mean nothing less >=
NOT GREATER THAN is semantically same as GREATER OR EQUAL.
Yes, you're right !< is a floationg-point operator bu
Zarathustra wrote:
I must to put a 'struct definition' inside a 'static if block' but other
'struct definition' doesn't see them.
static if(_WIN32IE !< 0x0400)
struct TVINSERTSTRUCT{
HTREEITEM hparent ;
HTREEITEM hinsertafter;
union tagDUMMYUNIONNAME{
TVITEMEX itemex;
TVITEM
I must to put a 'struct definition' inside a 'static if block' but other
'struct definition' doesn't see them.
static if(_WIN32IE !< 0x0400)
struct TVINSERTSTRUCT{
HTREEITEM hparent ;
HTREEITEM hinsertafter;
union tagDUMMYUNIONNAME{
TVITEMEX itemex;
TVITEM item;
}
tagDUMM
Lutger wrote:
i have two question related to ctfe:
1) returning .idup on local static arrays fail but I don't understand why
that should be:
string foo()
{
char[1] d;
d[0] = 'd';
return d.idup;
}
pragma(msg, foo()); // "Error: cannot evaluate foo() at compile time"
.idup is no
15 matches
Mail list logo