[gedit] Do not prefix macro names with underscores in C header snippet



commit 53827530d477cb22364d194e88bed991246fbb19
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Thu Apr 28 18:39:57 2016 +0200

    Do not prefix macro names with underscores in C header snippet
    
    Symbols (even preprocessor macro names) that begin with an underscore are
    reserved for the use of the compiler.

 plugins/snippets/data/chdr.xml |   24 ++++++++++++------------
 1 files changed, 12 insertions(+), 12 deletions(-)
---
diff --git a/plugins/snippets/data/chdr.xml b/plugins/snippets/data/chdr.xml
index 386763b..2ce94d7 100644
--- a/plugins/snippets/data/chdr.xml
+++ b/plugins/snippets/data/chdr.xml
@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <snippets language="chdr">
   <snippet id="once">
-    <text><![CDATA[#ifndef __${1:NAME}_H__
-#define __$1_H__
+    <text><![CDATA[#ifndef ${1:NAME}_H
+#define $1_H
 
 $0
 
-#endif /* __$1_H__ */
+#endif /* $1_H */
 ]]></text>
     <description>Header Include-Guard</description>
     <tag>once</tag>
@@ -125,8 +125,8 @@ $0]]></text>
     <tag>template</tag>
   </snippet>
   <snippet id="gobject">
-    <text><![CDATA[#ifndef __${1:NAME}_H__
-#define __$1_H__
+    <text><![CDATA[#ifndef ${1:NAME}_H
+#define $1_H
 $<
 global camel_str, module, name, type_str
 components = $1.split('_')
@@ -155,13 +155,13 @@ $<[1]: return camel_str > *$< return $1.lower()>_new (void);
 $0
 G_END_DECLS
 
-#endif /* __$1_H__ */]]></text>
+#endif /* $1_H */]]></text>
     <tag>gobject</tag>
     <description>GObject template</description>
   </snippet>
   <snippet id="ginterface">
-    <text><![CDATA[#ifndef __${1:NAME}_H__
-#define __$1_H__
+    <text><![CDATA[#ifndef ${1:NAME}_H
+#define $1_H
 
 #include <${2:glib-object.h}>
 
@@ -207,13 +207,13 @@ const gchar *$< return $1.lower()>_example_method ($<[1]: return camel_str > *se
 $0
 G_END_DECLS
 
-#endif /* __$1_H__ */]]></text>
+#endif /* $1_H */]]></text>
     <tag>ginterface</tag>
     <description>GObject interface</description>
   </snippet>
     <snippet>
-    <text><![CDATA[#ifndef __${1:NAME}_H__
-#define __$1_H__
+    <text><![CDATA[#ifndef ${1:NAME}_H
+#define $1_H
 
 #include <${2:glib-object.h}>
 
@@ -251,7 +251,7 @@ void $< return $1.lower()>_${5:free} ($<[1]: return camel_str > *${4:boxed_name}
 $0
 G_END_DECLS
 
-#endif /* __$1_H__ */]]></text>
+#endif /* $1_H */]]></text>
     <tag>gboxed</tag>
     <description>GBoxed template</description>
   </snippet>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]