Thread overview
[bindings/win32] Migration from typedef
Dec 21, 2011
Vladimir Panteleev
Dec 22, 2011
Jacob Carlborg
Dec 22, 2011
Andrej Mitrovic
Jan 10, 2012
Gerrit Wichert
Jan 07, 2012
Vladimir Panteleev
Jan 08, 2012
Vladimir Panteleev
December 21, 2011
Now that typedef is deprecated in D2, how should libraries that support both D1 and D2 adjust? Should it be simply changed to an alias, or replaced with a string mixin hack? What's the impact of changing typedefs to aliases in a widely-used library?
December 22, 2011
On 2011-12-21 23:56, Vladimir Panteleev wrote:
> Now that typedef is deprecated in D2, how should libraries that support
> both D1 and D2 adjust? Should it be simply changed to an alias, or
> replaced with a string mixin hack? What's the impact of changing
> typedefs to aliases in a widely-used library?

I was hoping that D2 would allow typedefs in a version statement, but that's not the case. D2 still recognizes "typedef" so it's not the same problem as with D1 and the new D2 keywords.

-- 
/Jacob Carlborg
December 22, 2011
I'd like to know this too. Currently wxd won't link if I change a typedef to an alias due to multiple definitions.
January 07, 2012
On Wednesday, 21 December 2011 at 22:56:36 UTC, Vladimir Panteleev wrote:
> Now that typedef is deprecated in D2, how should libraries that support both D1 and D2 adjust? Should it be simply changed to an alias, or replaced with a string mixin hack? What's the impact of changing typedefs to aliases in a widely-used library?

Here's a proposed patch:
http://dump.thecybershadow.net/3c5de02d8929799da17b3dbeabfa3576/typedef.diff

The TypeDef template is defined in basetsd.d (third file in diff).

Seems to work with D1 and D2.

Perhaps we should wait for the upcoming TypeDef library type in Phobos for D2?

I'll commit it if there are no objections/suggestions...
January 08, 2012
On Saturday, 7 January 2012 at 05:22:47 UTC, Vladimir Panteleev wrote:
> On Wednesday, 21 December 2011 at 22:56:36 UTC, Vladimir Panteleev wrote:
>> Now that typedef is deprecated in D2, how should libraries that support both D1 and D2 adjust? Should it be simply changed to an alias, or replaced with a string mixin hack? What's the impact of changing typedefs to aliases in a widely-used library?
>
> Here's a proposed patch:
> http://dump.thecybershadow.net/3c5de02d8929799da17b3dbeabfa3576/typedef.diff
>
> The TypeDef template is defined in basetsd.d (third file in diff).
>
> Seems to work with D1 and D2.
>
> Perhaps we should wait for the upcoming TypeDef library type in Phobos for D2?
>
> I'll commit it if there are no objections/suggestions...

Committed (revision 372).
January 10, 2012
On 22.12.2011 12:28, Andrej Mitrovic wrote:
> I'd like to know this too. Currently wxd won't link if I change a
> typedef to an alias due to multiple definitions.
>

I've had the same problems here on my linux box + some others.
But i've just finished fixing them and DMD 2.057actually successfully builds
the little testing app i'm developing to become more acquainted with D.

It is tested under Linux 32 bit only (OpenSuse 11.4 + Open Suse 12.1/64 using -m32)
but i think it should also work on Windows.

if you want to give it a try, checkout the 'dmd257linux' branch from

https://github.com/gwichert/wxd



Gerrit