#ifdef __x86_64__'s added where needed

1. Perl script to add "#ifdef DEBUG" wrappers to C source

I'm pretty sure this can be done with a 5 line (or so) Perl script, but
can't seem to figure it out.

I want to search through a C source file (actually, a number of files),
and for every line containing a printf, insert a preceding line, saying
"#ifdef DEBUG", and a succeeding line, saying "#endif" i.e.

/* STUFF */
printf ("Random status message\n");

would become:

/* STUFF */
#ifdef DEBUG
printf ("Random status message\n");

Any ideas?  (and yes, any accusations of chronic laziness are suitably


2. nice value problem

3. How to add ifdef condition in Makefile

4. New Linux user needs help!!!

5. How do you do '#ifdef Solaris'?

6. TEKTRONIX 4207 HELP....

7. Do I need to restart 'named' after adding domain(s)

8. Linux QuickTime?

9. script for parsing files for #if and #ifdef's

10. PATCH: ide-tape no longer needs this ifdef

11. #ifdef < You're compiling for Linux with g++ >

12. Need Help on #ifdef PLEASE !

13. I need an 'md,' but do I need a 'mkdev?'