January 09, 2005
Ant wrote:
> On Sat, 08 Jan 2005 15:24:34 +0100, Anders Runesson wrote:
> 
> 
>>>>are those the one on the patch at
>>>>http://sourceforge.net/tracker/index.php?func=detail&aid=1001314&group_id=97723&atid=618893 
>>>>
>>>>?
>>>>
>>>>let me know, I'll include it on the main development branch.
>>>>
>>>>Ant
>>>>
>>>>
>>>
>>>As it turns out, the changes I made aren't needed with the current DMD code.  That patch is all that is needed now.  The 'DotTypeExp' error is a gdc bug and fix for that will be out soon.
>>>
>>>David
>>>
>>
>>Here are the changes I made to get past the errors I met so far, for src/dui/ObjectG.d and src/event/EventHandler.d.
> 
> 
> Thank you both.
> I'll try the keep DUI compatible with GDC from now on
> (or at least I'll try to report problems here).
> 
> Ant
> 

Here are a few things a discovered after actually trying to run the test programs:

1. In order to produce working code, DUI must be compiled with the "-fall-sources" flag.  This makes GDC work like DMD when it produces multiple object file in one run.  The EventHandler patch is not needed when this flag is ued.

2. The DUITests program uses nested functions for event handlers like this:

void gtkDemo(Notebook notebook)
{
	void showTTextView()
	{
		new TTextView();
	}

	...
	Button button = new Button("Text View", &showTTextView);
	...	
}

This crashes when the button is clicked.  The problem is that GCC doesn't implement nested the same way as DMD.  This could be fixed, but would require some significant changes to the GCC code.  OTOH, I might be able to handle cases like these specially.

A "static" nested function would work now, but that would require a wrapper to make it a delegate.

David
1 2
Next ›   Last »