"version" predefined pragma

Derek Parnell derek at psych.ward
Tue Feb 21 20:15:34 PST 2006


On Wed, 22 Feb 2006 03:52:38 +0000 (UTC), Dave wrote:

> Along the same lines as pragma(lib,...) I'm wondering if it would make sense to
> add something like pragma(switch,...) also, e.g.:
> 
> pragma(switch,"-version=MY_VERSION");
> version(Windows)
> {
> pragma(switch,"-L/SUBSYSTEM:windows:5");
> }
> 
> That would act like the command-line:
> 
> C:\>dmd foo.d bar.d version=MY_VERSION -L/SUBSYSTEM:windows:5

You can do this sort of thing with Build.

version(build) { 
    pragma(export_version, MY_VERSION);
    version(Windows) {
        pragma (build_def, "EXETYPE NT");
        pragma (build_def, "SUBSYSTEM WINDOWS,4.0")
    }
}

Though the Windows subsystem is normally handled automatically but the
pragma allows you to override the standard values.

-- 
Derek
(skype: derek.j.parnell)
Melbourne, Australia
"Down with mediocracy!"
22/02/2006 3:10:50 PM



More information about the Digitalmars-d mailing list