www.digitalmars.com         C & C++   DMDScript  

D - aliasing linkage identifiers

reply "Lars Ivar Igesund" <larsivi stud.ntnu.no> writes:
Hi!

I think it would be useful to be able to alias the linkage
identifiers.

I want to do

version (Win32) {
  alias Windows lnkmod;
}
version (linux) {
  alias C lnkmod;
}

extern (lnkmod) {

  ...
  ...
  ...

}

As it is now, I need to put the whole extern block inside a
version block, thus doubling up the set of declarations. If
I'ver overlooked some other solution, please mention it :)

Lars Ivar Igesund
Sep 19 2003
next sibling parent "Walter" <walter digitalmars.com> writes:
I see your point. I'll have to think about it!
Sep 19 2003
prev sibling parent John Boucher <John_member pathlink.com> writes:
In article <bke681$2cdr$1 digitaldaemon.com>, Lars Ivar Igesund says...
Hi!

I think it would be useful to be able to alias the linkage
identifiers.

I want to do

version (Win32) {
  alias Windows lnkmod;
}
version (linux) {
  alias C lnkmod;
}

extern (lnkmod) {

  ...
  ...
  ...

}

As it is now, I need to put the whole extern block inside a
version block, thus doubling up the set of declarations. If
I'ver overlooked some other solution, please mention it :)

Lars Ivar Igesund
I'd use #define and pass it through a C preprocessor -- hee hee hee!! John Boucher -- Quite contrary The King had Humpty pushed.
Sep 19 2003