February 21, 2007
kris wrote:
>> Either that, or the o.w. linker has bugs in it. snn.lib works fine.
> 
> Anything is possible :)
> 
> Just for posterity, here's the OW linker output; almost all warnings:
> 
> Warning! W1027: file phobos.lib(typeinfo\ti_Acreal.d): redefinition of _D11TypeInfo_AC6__initZ ignored

That's a bug in the OW linker. COMDATs can be multiply defined.

> Warning! W1027: file phobos.lib(typeinfo\ti_Acreal.d): redefinition of _D11TypeInfo_AC7__ClassZ ignored
> Warning! W1027: file phobos.lib(typeinfo\ti_Acreal.d): redefinition of _D11TypeInfo_AC6__vtblZ ignored
> Warning! W1027: file phobos.lib(typeinfo\ti_creal.d): redefinition of _D10TypeInfo_C6__initZ ignored
> Warning! W1027: file phobos.lib(typeinfo\ti_creal.d): redefinition of _D10TypeInfo_C7__ClassZ ignored
> Warning! W1027: file phobos.lib(typeinfo\ti_creal.d): redefinition of _D10TypeInfo_C6__vtblZ ignored
> Warning! W1027: file phobos.lib(typeinfo\ti_double.d): redefinition of _D10TypeInfo_d6__initZ ignored
> Warning! W1027: file phobos.lib(typeinfo\ti_double.d): redefinition of _D10TypeInfo_D7__ClassZ ignored
> Warning! W1027: file phobos.lib(typeinfo\ti_double.d): redefinition of _D10TypeInfo_D6__vtblZ ignored
> Warning! W1027: file phobos.lib(typeinfo\ti_ptr.d): redefinition of _D10TypeInfo_p6__initZ ignored
> Warning! W1027: file phobos.lib(typeinfo\ti_ptr.d): redefinition of _D10TypeInfo_p7__ClassZ ignored
> Warning! W1027: file phobos.lib(typeinfo\ti_ptr.d): redefinition of _D10TypeInfo_p6__vtblZ ignored
> Warning! W1027: file snn.lib(..\core32\_exit2.c): redefinition of __Exit ignored
> Warning! W1027: file snn.lib(..\ios\stream.cpp): redefinition of istream &cdecl ws(istream &) ignored
> Error! E2166: file snn.lib(..\win32\constart.c): both __DllMainCRTStartup@12 and _mainCRTStartup marked as starting symbols
> Error! E2166: file snn.lib(..\win32\winstart.c): both __DllMainCRTStartup@12 and _WinMainCRTStartup marked as starting symbols

Those aren't errors. Multiple start addresses can be in the library, you just can't link both of them into the same exe.

> Warning! W1027: file snn.lib(..\WIN32\TRACE\TRACE.C): redefinition of _trace_setlogfilename ignored
> Warning! W1027: file snn.lib(..\WIN32\TRACE\TRACE.C): redefinition of _trace_setdeffilename ignored
> Warning! W1027: file snn.lib(..\WIN32\TRACE\TRACE.C): redefinition of _trace_term ignored
> Warning! W1027: file snn.lib(..\WIN32\TRACE\TRACE.C): redefinition of __trace_pro_n ignored
> Warning! W1027: file snn.lib(..\WIN32\TRACE\TRACE.C): redefinition of __trace_epi_n ignored
> Error! E2166: file snn.lib(..\win32\wconstar.c): both __DllMainCRTStartup@12 and _wmainCRTStartup marked as starting symbols
> Error! E2166: file snn.lib(..\win32\wwinstar.c): both __DllMainCRTStartup@12 and _wWinMainCRTStartup marked as starting symbols
> Warning! W1027: file snn.lib(..\core\_wfopen.c): redefinition of __wfopen ignored
> 
February 21, 2007
Walter Bright wrote:
> kris wrote:
> 
>>> Either that, or the o.w. linker has bugs in it. snn.lib works fine.
>>
>>
>> Anything is possible :)
>>
>> Just for posterity, here's the OW linker output; almost all warnings:
>>
>> Warning! W1027: file phobos.lib(typeinfo\ti_Acreal.d): redefinition of _D11TypeInfo_AC6__initZ ignored
> 
> 
> That's a bug in the OW linker. COMDATs can be multiply defined.
> 
>> Error! E2166: file snn.lib(..\win32\constart.c): both __DllMainCRTStartup@12 and _mainCRTStartup marked as starting symbols
>> Error! E2166: file snn.lib(..\win32\winstart.c): both __DllMainCRTStartup@12 and _WinMainCRTStartup marked as starting symbols
> 
> 
> Those aren't errors. Multiple start addresses can be in the library, you just can't link both of them into the same exe.
> 
>> Warning! W1027: file snn.lib(..\WIN32\TRACE\TRACE.C): redefinition of 


Thanks; that's useful to know
February 21, 2007
Walter Bright wrote:
> Cleanup of compile time function execution issues.
> 
> http://www.digitalmars.com/d/changelog.html
> 
> http://ftp.digitalmars.com/dmd.1.007.zip

Is there a reason why this shouldn't work?! It seems to me this is the most basic usage for mixin & compile time functions.
--------------------
import std.stdio;

void main()
{
	writefln( getstruct( "test_struct", "int x; int y;" ) );	
}

mixin( getstruct( "test_struct", "int x; int y;" ) );


char[] getstruct( char[] name, char[] sbody )
{
    return "struct " ~ name ~ " { " ~ sbody ~ " }";
}
----------------

Compiling this, I get:
meta.d(8): Error: cannot evaluate getstruct("test_struct","int x; int y;") at compile time
attribute argument to mixin must be a string, not (getstruct("test_struct","int x; int y;"))

when I comment out the mixin() line, it compiles, and when I run the program it outputs:
struct test_struct { int x; int y; }
February 21, 2007
Hasan Aljudy wrote:
> Is there a reason why this shouldn't work?! It seems to me this is the most basic usage for mixin & compile time functions.

Try putting the definition of getstruct() before the mixin.
February 21, 2007

Walter Bright wrote:
> Hasan Aljudy wrote:
>> Is there a reason why this shouldn't work?! It seems to me this is the most basic usage for mixin & compile time functions.
> 
> Try putting the definition of getstruct() before the mixin.

Ah!! Thanks :D

It's considered a bug though, isn't it? this dependency on the order of declaration ...
February 21, 2007
i award you an oscar for productivity :)
evaluation of classes works properly now - new Ddbg release coming up...

Walter Bright wrote:
> Cleanup of compile time function execution issues.
> 
> http://www.digitalmars.com/d/changelog.html
> 
> http://ftp.digitalmars.com/dmd.1.007.zip
February 21, 2007
Jascha Wetzel wrote:
> i award you an oscar for productivity :)
> evaluation of classes works properly now - new Ddbg release coming up...

Sweet! that will be a first :)
February 21, 2007
Hasan Aljudy wrote:
> It's considered a bug though, isn't it? this dependency on the order of declaration ...

It'll be a while before that all gets sorted out.
February 21, 2007
I get errors like this with DWT.  They go away when I add -v1 to the command line.  I didn't see this in the changelog, but I guess it's the disallowing implicit conversion from objects to void* that was discussed.

dwt\accessibility\accessible.d(507): Error: cannot implicitly convert expression (cast(IUnknown)(this.objIAccessible)) of type std.c.windows.com.IUnknown to void*

C:\prog\dmd\import\dwt\ole\win32\oleclientsite.d(544): Error: cannot implicitly convert expression (cast(IAdviseSink)(this.iAdviseSink)) of type dwt.internal.oe.win32.OBJIDL.IAdviseSink to void*
February 21, 2007
Walter Bright kirjoitti:
> Cleanup of compile time function execution issues.
> 
> http://www.digitalmars.com/d/changelog.html
> 
> http://ftp.digitalmars.com/dmd.1.007.zip

Great. It also seems the downloads got a bit faster! :) On average 55 kB/s vs old 7 kB/s.