[json-glib] Move the single include guard after multiple inclusion one
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [json-glib] Move the single include guard after multiple inclusion one
- Date: Wed, 4 Dec 2013 13:52:46 +0000 (UTC)
commit 0de776ea67869b692ee8bd709fd70c0e2368d9fc
Author: Emmanuele Bassi <ebassi gnome org>
Date: Wed Dec 4 12:41:06 2013 +0000
Move the single include guard after multiple inclusion one
GCC (and other compilers) can optimise multiple inclusion of headers if
they find the:
#ifndef FOO
#define FOO
#endif
pattern as the first thing inside a header. The single-header inclusion
guard was preventing that from happening, so we need to move it inside
the multiple inclusion guard.
json-glib/json-builder.h | 6 +++---
json-glib/json-enum-types.h.in | 6 +++---
json-glib/json-generator.h | 6 +++---
json-glib/json-parser.h | 6 +++---
json-glib/json-path.h | 6 +++---
json-glib/json-reader.h | 6 +++---
json-glib/json-types.h | 6 +++---
json-glib/json-version.h.in | 6 +++---
8 files changed, 24 insertions(+), 24 deletions(-)
---
diff --git a/json-glib/json-builder.h b/json-glib/json-builder.h
index e034193..093f67c 100644
--- a/json-glib/json-builder.h
+++ b/json-glib/json-builder.h
@@ -20,13 +20,13 @@
* Luca Bruno <lethalman88 gmail com>
*/
+#ifndef __JSON_BUILDER_H__
+#define __JSON_BUILDER_H__
+
#if !defined(__JSON_GLIB_INSIDE__) && !defined(JSON_COMPILATION)
#error "Only <json-glib/json-glib.h> can be included directly."
#endif
-#ifndef __JSON_BUILDER_H__
-#define __JSON_BUILDER_H__
-
#include <json-glib/json-types.h>
G_BEGIN_DECLS
diff --git a/json-glib/json-enum-types.h.in b/json-glib/json-enum-types.h.in
index 96f565e..c36e433 100644
--- a/json-glib/json-enum-types.h.in
+++ b/json-glib/json-enum-types.h.in
@@ -1,11 +1,11 @@
/*** BEGIN file-header ***/
+#ifndef __JSON_ENUM_TYPES_H__
+#define __JSON_ENUM_TYPES_H__
+
#if !defined(__JSON_GLIB_INSIDE__) && !defined(JSON_COMPILATION)
#error "Only <json-glib/json-glib.h> can be included directly."
#endif
-#ifndef __JSON_ENUM_TYPES_H__
-#define __JSON_ENUM_TYPES_H__
-
#include <glib-object.h>
G_BEGIN_DECLS
diff --git a/json-glib/json-generator.h b/json-glib/json-generator.h
index eb7cdba..3ce7d08 100644
--- a/json-glib/json-generator.h
+++ b/json-glib/json-generator.h
@@ -21,13 +21,13 @@
* Emmanuele Bassi <ebassi linux intel com>
*/
+#ifndef __JSON_GENERATOR_H__
+#define __JSON_GENERATOR_H__
+
#if !defined(__JSON_GLIB_INSIDE__) && !defined(JSON_COMPILATION)
#error "Only <json-glib/json-glib.h> can be included directly."
#endif
-#ifndef __JSON_GENERATOR_H__
-#define __JSON_GENERATOR_H__
-
#include <json-glib/json-types.h>
#include <gio/gio.h>
diff --git a/json-glib/json-parser.h b/json-glib/json-parser.h
index 894a80b..9988915 100644
--- a/json-glib/json-parser.h
+++ b/json-glib/json-parser.h
@@ -21,13 +21,13 @@
* Emmanuele Bassi <ebassi linux intel com>
*/
+#ifndef __JSON_PARSER_H__
+#define __JSON_PARSER_H__
+
#if !defined(__JSON_GLIB_INSIDE__) && !defined(JSON_COMPILATION)
#error "Only <json-glib/json-glib.h> can be included directly."
#endif
-#ifndef __JSON_PARSER_H__
-#define __JSON_PARSER_H__
-
#include <glib-object.h>
#include <gio/gio.h>
#include <json-glib/json-types.h>
diff --git a/json-glib/json-path.h b/json-glib/json-path.h
index 2bae608..6a30932 100644
--- a/json-glib/json-path.h
+++ b/json-glib/json-path.h
@@ -20,13 +20,13 @@
* Emmanuele Bassi <ebassi linux intel com>
*/
+#ifndef __JSON_PATH_H__
+#define __JSON_PATH_H__
+
#if !defined(__JSON_GLIB_INSIDE__) && !defined(JSON_COMPILATION)
#error "Only <json-glib/json-glib.h> can be included directly."
#endif
-#ifndef __JSON_PATH_H__
-#define __JSON_PATH_H__
-
#include <json-glib/json-types.h>
G_BEGIN_DECLS
diff --git a/json-glib/json-reader.h b/json-glib/json-reader.h
index 6ee0b54..14c7cad 100644
--- a/json-glib/json-reader.h
+++ b/json-glib/json-reader.h
@@ -20,13 +20,13 @@
* Emmanuele Bassi <ebassi linux intel com>
*/
+#ifndef __JSON_READER_H__
+#define __JSON_READER_H__
+
#if !defined(__JSON_GLIB_INSIDE__) && !defined(JSON_COMPILATION)
#error "Only <json-glib/json-glib.h> can be included directly."
#endif
-#ifndef __JSON_READER_H__
-#define __JSON_READER_H__
-
#include <json-glib/json-types.h>
G_BEGIN_DECLS
diff --git a/json-glib/json-types.h b/json-glib/json-types.h
index 3f7ff52..366d0df 100644
--- a/json-glib/json-types.h
+++ b/json-glib/json-types.h
@@ -21,13 +21,13 @@
* Emmanuele Bassi <ebassi linux intel com>
*/
+#ifndef __JSON_TYPES_H__
+#define __JSON_TYPES_H__
+
#if !defined(__JSON_GLIB_INSIDE__) && !defined(JSON_COMPILATION)
#error "Only <json-glib/json-glib.h> can be included directly."
#endif
-#ifndef __JSON_TYPES_H__
-#define __JSON_TYPES_H__
-
#include <glib-object.h>
G_BEGIN_DECLS
diff --git a/json-glib/json-version.h.in b/json-glib/json-version.h.in
index bc05f1b..c46ff49 100644
--- a/json-glib/json-version.h.in
+++ b/json-glib/json-version.h.in
@@ -21,13 +21,13 @@
* Emmanuele Bassi <ebassi linux intel com>
*/
+#ifndef __JSON_VERSION_H__
+#define __JSON_VERSION_H__
+
#if !defined(__JSON_GLIB_INSIDE__) && !defined(JSON_COMPILATION)
#error "Only <json-glib/json-glib.h> can be included directly."
#endif
-#ifndef __JSON_VERSION_H__
-#define __JSON_VERSION_H__
-
/**
* SECTION:json-version
* @short_description: JSON-GLib version checking
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]