https://issues.dlang.org/show_bug.cgi?id=12892

yebblies <yebbl...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |yebbl...@gmail.com

--- Comment #9 from yebblies <yebbl...@gmail.com> ---
(In reply to Walter Bright from comment #3)
> 
> 6. If you really need this behavior, it can easily (but not prettily) be
> done using string mixins:
> 
>  enum string mydeclarations = q{
>     int a;
>     void foo();
>  };
>  version(Win32) {
>   enum string linkage = "Windows";
>  } else {
>   enum string linkage = "C";
>  }
>  mixin( "extern(" ~ linkage ~ ") {" ~ mydeclarations ~ "}" );

If you really need this behavior it can be done TRIVIALLY with

extern(System):

...

--

Reply via email to