[lib,4/5] c_client.py: Use compliant header guard

Submitted by Daniel Martin on Nov. 22, 2013, 10:27 p.m.

Details

Message ID 1385159252-14436-5-git-send-email-consume.noise@gmail.com
State New
Headers show

Not browsing as part of any series.

Commit Message

Daniel Martin Nov. 22, 2013, 10:27 p.m.
Don't use leading underscores in the name of the header guard.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70680
Signed-off-by: Daniel Martin <consume.noise@gmail.com>
---
 src/c_client.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Patch hide | download patch | download mbox

diff --git a/src/c_client.py b/src/c_client.py
index 2bca0c3..59cc19a 100644
--- a/src/c_client.py
+++ b/src/c_client.py
@@ -171,8 +171,8 @@  def c_open(self):
     _h(' * @{')
     _h(' **/')
     _h('')
-    _h('#ifndef __%s_H', _ns.header.upper())
-    _h('#define __%s_H', _ns.header.upper())
+    _h('#ifndef %s_H', _ns.header.upper())
+    _h('#define %s_H', _ns.header.upper())
     _h('')
     _h('#include "xcb.h"')
 
@@ -223,7 +223,7 @@  def c_close(self):
     _h('#endif')
 
     _h('')
-    _h('#endif')
+    _h('#endif /* %s_H */', _ns.header.upper())
     _h('')
     _h('/**')
     _h(' * @}')

Comments

On Fri, Nov 22, 2013 at 11:27:31PM +0100, Daniel Martin wrote:
> Don't use leading underscores in the name of the header guard.
> 
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70680
> Signed-off-by: Daniel Martin <consume.noise@gmail.com>
> ---
>  src/c_client.py | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/src/c_client.py b/src/c_client.py
> index 2bca0c3..59cc19a 100644
> --- a/src/c_client.py
> +++ b/src/c_client.py
> @@ -171,8 +171,8 @@ def c_open(self):
>      _h(' * @{')
>      _h(' **/')
>      _h('')
> -    _h('#ifndef __%s_H', _ns.header.upper())
> -    _h('#define __%s_H', _ns.header.upper())
> +    _h('#ifndef %s_H', _ns.header.upper())
> +    _h('#define %s_H', _ns.header.upper())

As long as you're changing these, can you please change it to
XCB_%s_H_INCLUDED, to minimize the chance of conflict with a user
symbol?

</bikeshed>

>      _h('#include "xcb.h"')
>  
> @@ -223,7 +223,7 @@ def c_close(self):
>      _h('#endif')
>  
>      _h('')
> -    _h('#endif')
> +    _h('#endif /* %s_H */', _ns.header.upper())
>      _h('')
>      _h('/**')
>      _h(' * @}')
> -- 
> 1.8.4.2
> 
> _______________________________________________
> Xcb mailing list
> Xcb@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/xcb