Fixing C-style alias declarations.

Gary Willoughby via Digitalmars-d digitalmars-d at puremagic.com
Thu Sep 4 10:20:46 PDT 2014


On Wednesday, 20 August 2014 at 00:17:06 UTC, ketmar via 
Digitalmars-d wrote:
> On Wed, 20 Aug 2014 00:05:04 +0000
> Brian Schott via Digitalmars-d <digitalmars-d at puremagic.com> 
> wrote:
>
> i think that it's time to kill both c-like array declarations 
> and
> old-style aliases w/o '=' (ok, let 'alias this' live for now). 
> this
> will solve all problems.

I've had problems in the past using the new alias syntax when 
porting C headers.

Stuff like this:

alias extern(C) uint function(Tcl_HashTable* tablePtr, void* 
keyPtr) nothrow Tcl_HashKeyProc;
alias extern(C) int function(void* keyPtr, Tcl_HashEntry* hPtr) 
nothrow Tcl_CompareHashKeysProc;
alias extern(C) Tcl_HashEntry* function(Tcl_HashTable* tablePtr, 
void* keyPtr) nothrow Tcl_AllocHashEntryProc;
alias extern(C) void function(Tcl_HashEntry* hPtr) nothrow 
Tcl_FreeHashEntryProc;

Stuff like this used to fail in the new style.

Incidentally, i've just ported this to the new style and it now 
compiles. I suggest keeping the old style for a while longer.


More information about the Digitalmars-d mailing list