I have a chunk of C and C++ code. I have to release the source to two different customers. I don’t want them to see what the features others having. So, I’m planning to use switches for compilation. When to deliver the code, I would like to have few lines of the code stripped out. I know I can write a script to do it but I would like to know if are there any tools that exist to do this job.
#ifdef CUSTOMER_1
Code for Customer 1
#else //Customer_2
Code for Customer 2
#endif
For customer 2, I would like to have the code removed which comes under #ifdef and #else. I would like to remove the line #endif. Are there any tools that are readily available for this?
There’s a utility called
unifdefthat’s designed exactly for this purpose.