[lttng-dev] [PATCH] lttng-gen-tp: Allow generation from templates in subdirectories

Shawn Bohrer sbohrer at rgmadvisors.com
Wed Aug 29 16:39:59 EDT 2012


If a template is located in a subdirectory as is common in large
software projects then the include guard will contain forward slash
characters which are not allowed.  This replaces those characters with
an underscore.  Additional the include guards previously started with
an underscore and capital letter which is reserved thus this
additionally removes the leading underscore.

Fixes: #298

Signed-off-by: Shawn Bohrer <sbohrer at rgmadvisors.com>
---
 tools/lttng-gen-tp |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/lttng-gen-tp b/tools/lttng-gen-tp
index d54559a..8cd3191 100755
--- a/tools/lttng-gen-tp
+++ b/tools/lttng-gen-tp
@@ -61,7 +61,7 @@ extern "C"{{
 
     def write(self):
         outputFile = open(self.outputFilename,"w")
-        includeGuard = "_"+self.outputFilename.upper().replace(".","_")
+        includeGuard = self.outputFilename.upper().replace(".","_").replace("/","_")
 
         outputFile.write(HeaderFile.HEADER_TPL.format(providerName=self.template.domain,
                                            includeGuard = includeGuard,
-- 
1.7.7.6


-- 

---------------------------------------------------------------
This email, along with any attachments, is confidential. If you 
believe you received this message in error, please contact the 
sender immediately and delete all copies of the message.  
Thank you.



More information about the lttng-dev mailing list