d-widget-toolkit / org.eclipse.swt.win32.win32.x86

5 stars 6 forks source link

Fixes for dmd 2.067.0. #18

Closed kntroh closed 9 years ago

kntroh commented 9 years ago

Fixes for dmd 2.067.0.

I removed compile error and warning.

jacob-carlborg commented 9 years ago

I'm not sure if this is the correct solution. I know the druntime developers want to make lock.wait nothrow. Which will break this code [1]. I'm wondering if we should copy the current implementation of lock.wait to DWT instead and do all this ourself. See [2] for reference.

[1] https://github.com/kntroh/org.eclipse.swt.win32.win32.x86/blob/for2067/src/org/eclipse/swt/widgets/Synchronizer.d#L196-L211

[2] http://forum.dlang.org/post/54E4870B.6060204@dawg.eu

kntroh commented 9 years ago

In future, SyncError will be changed to return value?

If so, I can write this:

static if (is(typeof(lock.wait()) == void)) {
    try {
        lock.wait();
    } catch (SyncError e) {
        interrupted = true;
    }
} else {
    interrupted = lock.wait();
}
jacob-carlborg commented 9 years ago

Unfortunately no. lock.wait will still return voidand will thrown an error instead of an exception. It's legal to throw errors in a function declared as nothrow. Errors are not supposed to be catchable and should immediately halt the application. Technically you can catch an error today, but this can change in any new release.

See this pull request [1] of how the code will most likely look like. The pull request was merged but has since then been reverted. It caused some problems with vibe.d when updating that to DMD 2.067.0.

[1] https://github.com/D-Programming-Language/druntime/pull/1013/files

kntroh commented 9 years ago

Sorry, I don't know what to do solve this problem.

Maybe we should copy the old condition.d to DWT base.

https://github.com/D-Programming-Language/druntime/blob/2.066/src/core/sync/condition.d

jacob-carlborg commented 9 years ago

Maybe we should copy the old condition.d to DWT base.

That's exactly what I was thinking.

kntroh commented 9 years ago

I copied it now. And sent pull request for DWT base.

Updated this pull request.

jacob-carlborg commented 9 years ago

Is this necessary for Linux also?

kntroh commented 9 years ago

I'll check it from now.

By the way, There is a problem with the current DWT linux.

I had worked for linux 64 version few month ago. (the work is based on working of JinShil.) But it didn't worked well. The current DWT based on GNOME2 maybe. And GNOME3 the API has been changed from 2. I'm not able to cope with it yet.

jacob-carlborg commented 9 years ago

Thanks for all your fixes.

jacob-carlborg commented 9 years ago

By the way, There is a problem with the current DWT linux.

I'm not sure I understand. Is the problem that DWT is based on GNOME2 and not 3?

kntroh commented 9 years ago

In GNOME3, Structures such as GtkWidget and GtkWindow is encapsulated. If use a structure member directly, Access Violation occurs.

We need to fixes such codes. For example: https://github.com/kntroh/org.eclipse.swt.gtk.linux.x86/blob/for2067linux/src/org/eclipse/swt/internal/gtk/OS.d#L2305

It was difficult for me.

jacob-carlborg commented 9 years ago

How important is it to support GNOME3?

BTW, I've started to work on a tool to automatically port SWT to D. It's available here [1].

[1] https://github.com/d-widget-toolkit/jport/tree/dev

kntroh commented 9 years ago
How important is it to support GNOME3?

Oh, It isn't important now. I'll reconsider.

BTW, I've started to work on a tool to automatically port SWT to D. It's available here [1].

It's the goal of the DWT certainly. I learn Scala when I have time.

jacob-carlborg commented 9 years ago

SWT 4.3 added early access support for GTK3 and in 4.4 it became the default version (if installed). DWT is very far behind that. I'm not sure how much sense it makes to update DWT, at the current version, to support GTK3. Personally I will put my time in JPort and try to make that useable. If you would like to add support for GTK3 I will gladly accept pull requests.

kntroh commented 9 years ago

Thanks. If I get results, I will send it.