Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!lll-winken!uunet!mcvax!unido!fauern!immd4.informatik.uni-erlangen.de!dkhusema From: dkhusema@immd4.informatik.uni-erlangen.de (Dirk Husemann) Newsgroups: comp.os.minix Subject: Re^2: Future of Minix Message-ID: <465@medusa.informatik.uni-erlangen.de> Date: 17 Jul 89 10:03:57 GMT References: <19654@louie.udel.EDU> <2885@ast.cs.vu.nl> Organization: CS Department of the University of Erlangen-Nuremberg, West Germany Lines: 58 ast@cs.vu.nl (Andy Tanenbaum) writes: >In article <19654@louie.udel.EDU> V61%DHDURZ1.BITNET@cunyvm.cuny.edu (Ronald Lamprecht) writes: >>The additional code should >>be included in #ifdef DEBUG -- #endif so that it is possible to generate >>a fast run-time library and a debugging library version. >Argh! I think #ifdefs make code very hard to read and ugly. I am not all >that wild about the idea. How about using the #ifdef-#endif constructs at a different place (header file?) and just put a macro at the appropiate place - doesn't that look nicer? E.g. db.h [header file]: #ifdef DEBUG #define DB2(format, arg1, arg2) /* something to print the args accor- ding to the format string */ #define DB3(format, arg1, arg2, arg3) /* ditto */ ... #else /* DEBUG */ #define DB2(format, arg1, arg2) #define DB3(format, arg1, arg2, arg3) ... #endif /* DEBUG */ codefile.c [code file]: codecall(msg, count) char *msg; int count; { DB2("codecall(%s, %d)\n", msg, count); ... } I think this wouldn't look too bad, but should do it! How about it? >Andy Tanenbaum (ast@cs.vu.nl) Dirk Husemann ------------------ Smile, tomorrow will be worse! -------------- Email: dkhusema@immd4.informatik.uni-erlangen.de Or: {pyramid,unido}!fauern!immd4.informatik.uni-erlangen.de!dkhusema Mail: Dirk Husemann, Aufsess-Str. 19, D-8520 Erlangen, (Home) West Germany (Busi- University of Erlangen-Nuremberg, Computer Science Dep., ness) IMMD IV, Martensstr. 1, D-8520 Erlangen, West Germany Phone: (Home) +49 9131 302036, (Business) +49 9131 857908 -- Beam me up, Scotty, there's no intelligent life down here! -- --------------- My opinions are mine, mine, mine ---------------