DerelictOrg / DerelictAllegro5

A dynamic binding to the Allegro 5 library for the D Programming Language.
3 stars 1 forks source link

Made Allegro API @nogc. #1

Closed lmbarros closed 8 years ago

lmbarros commented 8 years ago

I didn't test this too much, but so far so good. Anyway, I think this simple change makes sense (and this is what the SDL2 bindings already do).

mdparker commented 8 years ago

Sure, that's fine. All of the bindings in Derelict should have @nogc, I just haven't been actively maintaining this one. However, in order to compile with pre-2.066 versions of the D front end, the module should import derelict.util.system and @nogc needs to come before nothrow. @nogc was not part of the language before 2.066, so to maintain backward compatibility, it's implemented as a UDA in derelict.util.system. That, of course, does nothing, but it allows the code to compile. Unfortunately, UDAs can't (or couldn't -- not sure if it's been fixed, but definitely an issue pre-2.066) follow built-in attributes in declarations. So @nogc has to precede nothrow for backward compatibility.

It should also be applied to the other modules (color, dialog, font, etc...). Rather than merging the PR, I'll go ahead and get it done.

mdparker commented 8 years ago

Implemented and tagged as 0.0.3. I think I should give some more attention to this and get ready for a 1.0 release before Allegro 5.2 becomes official.