Fix INCLUDE_GUARD in create-module.py
authorVedran Miletić <rivanvx@gmail.com>
Thu, 28 Mar 2013 10:31:56 +0100
changeset 9272 32d40ab86df5
parent 9271 85e753b6676c
child 9273 537e3d356935
Fix INCLUDE_GUARD in create-module.py This patch fixes two separate issues: first, it replaces "-" by "_" in addition to capitalizing module name when creating include guards, second, it names it consistently with the rest of ns-3.
src/create-module.py
--- a/src/create-module.py	Wed Mar 27 02:14:57 2013 +0100
+++ b/src/create-module.py	Thu Mar 28 10:31:56 2013 +0100
@@ -344,7 +344,7 @@
     model_cc.close()
 
     model_h = file(os.path.join(moduledir, "model", "%s.h" % modname), "wt")
-    model_h.write(MODEL_H_TEMPLATE % dict(MODULE=modname, INCLUDE_GUARD="__%s_H__" % (modname.upper()),))
+    model_h.write(MODEL_H_TEMPLATE % dict(MODULE=modname, INCLUDE_GUARD="%s_H" % (modname.replace("-", "_").upper()),))
     model_h.close()