minwin

Anders F Björklund afb at algonet.se
Wed Nov 29 13:20:55 PST 2006


Walter Bright wrote:

> I believe it is harder for the initial programmer, but much simpler for 
> the maintenance programmer. Have you ever been faced with maintaining a 
> piece of C code with complicated #if statements, and you have no idea if 
> FOO is defined or not, or what it is #define'd to? You've got to look at 
> the module, the freakin' command line, the makefile, the #include path, 
> every freakin' #include file, which of course use more #if's to 
> optionally #include other freakin' files, and such #defines are even 
> created using freakin' complicated token pasting!

Yes I have, but it also allows for writing very portable code.
I've also done Java code that did not have macro facilities,
so even if it only ran on a handful setups it still had to use
code generators or force a very specific setup upon everybody.

I'm sure that things would be different if writing new D code,
and not just porting C/C++ stuff over - which is where I usually
run into wanting a #ifndef or other similar predefined versions.
I don't *want* to change the macros, since they're in the API...


BTW: For compatibility with Windows (of wxD) I had to rewrite the sh 
scripts as programs, so now it should be working on Windows and Unix.
They will check the current setup, and output the -version/-fversion.
(it writes a text file or config.mak, to include into the Makefiles)
Not sure if it's easier there (compared to a module), but it works OK.
Latest version will even write the library pragmas for Build to use...
Will be good if you don't want to use the GNU toolchain (i.e. MinGW) ?
(as the original version just used wx-config/pkg-config and backticks)

--anders



More information about the Digitalmars-d-announce mailing list