diff --git a/scripts/templates/template-cpp.cpp b/scripts/templates/template-cpp.cpp
index 7a8797698a3002f0b13251865033fe518ce070bb..35d8441c87e4d6bb9d4870a12552844ba2c3ec58 100644
--- a/scripts/templates/template-cpp.cpp
+++ b/scripts/templates/template-cpp.cpp
@@ -26,4 +26,5 @@
 */
 
 
-#'%c'%35#include "#filename#.h"
+#'' if ( skip_h ) else '%cinclude "%s.h"' % (35,filename)#
+
diff --git a/scripts/templates/template-h.h b/scripts/templates/template-h.h
index de40a8e071ed8c78f26905a253b7f0e4413b771b..ce7b4ddc8774c2d9c881a4d58e18dc4ce2c61833 100644
--- a/scripts/templates/template-h.h
+++ b/scripts/templates/template-h.h
@@ -28,4 +28,4 @@
 #'%c'%35#define LL_#filename.upper().replace('-','_')#_H
 
 
-#'%c'%35#endif LL_#filename.upper().replace('-','_')#_H
+#'%c'%35#endif // LL_#filename.upper().replace('-','_')#_H