Permalink
Browse files

Sanitize our include guards somewhat

Avoid double underscores to avoid clashing with reserved symbols. Also
adding BARNOWL to guard names. While I'm at it, owl_prototypes.h could
use guards.
  • Loading branch information...
1 parent 86f740e commit 06adc2597733314a26b26261ddbb33995304e8c3 @davidben davidben committed Aug 7, 2010
Showing with 16 additions and 14 deletions.
  1. +4 −2 codelist.pl
  2. +3 −3 filterproc.h
  3. +3 −3 owl.h
  4. +3 −3 owl_perl.h
  5. +3 −3 window.h
View
@@ -1,5 +1,8 @@
#! /usr/bin/perl
+my $guard_symbol = "INC_BARNOWL_OWL_PROTOTYPES_H";
+print "#ifndef $guard_symbol\n";
+print "#define $guard_symbol\n";
foreach $file (@ARGV) {
open(FILE, $file);
@@ -30,5 +33,4 @@
close(FILE);
print "\n";
}
-
-
+print "#endif /* $guard_symbol */\n";
View
@@ -1,9 +1,9 @@
-#ifndef __FILTER_PROC_H__
-#define __FILTER_PROC_H__
+#ifndef INC_BARNOWL_FILTER_PROC_H
+#define INC_BARNOWL_FILTER_PROC_H
int call_filter(const char *prog,
const char *const *argv,
const char *in,
char **out, int *status);
-#endif
+#endif /* INC_BARNOWL_FILTER_PROC_H */
View
6 owl.h
@@ -6,8 +6,8 @@
* file included with the distribution for more information.
*/
-#ifndef INC_OWL_H
-#define INC_OWL_H
+#ifndef INC_BARNOWL_OWL_H
+#define INC_BARNOWL_OWL_H
#ifdef HAVE_STDBOOL_H
#include <stdbool.h>
@@ -647,4 +647,4 @@ int ZGetSubscriptions(ZSubscription_t *, int *);
int ZGetLocations(ZLocations_t *,int *);
#endif
-#endif /* INC_OWL_H */
+#endif /* INC_BARNOWL_OWL_H */
View
@@ -1,5 +1,5 @@
-#ifndef INC_OWL_PERL_H
-#define INC_OWL_PERL_H
+#ifndef INC_BARNOWL_OWL_PERL_H
+#define INC_BARNOWL_OWL_PERL_H
#define OWL_PERL_VOID_CALL (void)POPs;
@@ -52,4 +52,4 @@
LEAVE; \
}
-#endif /* INC_PERL_PERL_H */
+#endif /* INC_BARNOWL_OWL_PERL_H */
View
@@ -1,5 +1,5 @@
-#ifndef __BARNOWL_WINDOW_H__
-#define __BARNOWL_WINDOW_H__
+#ifndef INC_BARNOWL_WINDOW_H
+#define INC_BARNOWL_WINDOW_H
#include <glib.h>
#include <glib-object.h>
@@ -66,4 +66,4 @@ void owl_window_fill_parent_cb(owl_window *parent, void *user_data);
G_END_DECLS
-#endif /* __BARNOWL_WINDOW_H__ */
+#endif /* INC_BARNOWL_WINDOW_H */

0 comments on commit 06adc25

Please sign in to comment.