telepathy-logger: Include config.h as the first thing in every .c file

Debarshi Ray debarshir at kemper.freedesktop.org
Wed Jan 9 06:32:24 PST 2013


Module: telepathy-logger
Branch: master
Commit: 33531660b4d5c6bb1450ac80686e75012a06a7eb
URL:    http://cgit.freedesktop.org/telepathy/telepathy-logger/commit/?id=33531660b4d5c6bb1450ac80686e75012a06a7eb

Author: Debarshi Ray <debarshir at freedesktop.org>
Date:   Wed Jan  9 13:43:49 2013 +0100

Include config.h as the first thing in every .c file

This is Autoconf best-practice, and ensures that the GLib and Telepathy
version-selection macros defined by configure.ac work as intended.

Including config.h turns on ENABLE_DEBUG, which in turn leads to the
usage of _tpl_debug_set_flags_from_env. In those cases we should
include telepathy-logger/debug-internal.h also.

Fixes: https://bugs.freedesktop.org/59165

---

 extensions/extensions.c                |    2 ++
 src/test-api.c                         |    2 ++
 telepathy-logger/util.c                |    2 ++
 tests/dbus/test-log-manager.c          |    2 ++
 tests/dbus/test-tpl-log-iter-pidgin.c  |    3 +++
 tests/dbus/test-tpl-log-iter-xml.c     |    3 +++
 tests/dbus/test-tpl-log-store-pidgin.c |    2 ++
 tests/dbus/test-tpl-log-store-xml.c    |    2 ++
 tests/dbus/test-tpl-log-walker.c       |    3 +++
 tests/dbus/test-tpl-observer.c         |    2 ++
 tests/lib/simple-account-manager.c     |    2 ++
 tests/lib/simple-account.c             |    2 ++
 tests/test-tpl-conf.c                  |    2 ++
 13 files changed, 29 insertions(+), 0 deletions(-)

diff --git a/extensions/extensions.c b/extensions/extensions.c
index a47e0e1..0f85042 100644
--- a/extensions/extensions.c
+++ b/extensions/extensions.c
@@ -1,3 +1,5 @@
+#include "config.h"
+
 #include "extensions.h"
 
 #include <telepathy-glib/proxy-subclass.h>
diff --git a/src/test-api.c b/src/test-api.c
index 1f8f6cf..4a2acaa 100644
--- a/src/test-api.c
+++ b/src/test-api.c
@@ -19,6 +19,8 @@
  */
 
 
+#include "config.h"
+
 #include <glib.h>
 
 #include <telepathy-glib/telepathy-glib.h>
diff --git a/telepathy-logger/util.c b/telepathy-logger/util.c
index ba14704..fd871bf 100644
--- a/telepathy-logger/util.c
+++ b/telepathy-logger/util.c
@@ -20,6 +20,8 @@
  *          Richard Hult <richard at imendio.com>
  */
 
+#include "config.h"
+
 #include "util-internal.h"
 
 #include <errno.h>
diff --git a/tests/dbus/test-log-manager.c b/tests/dbus/test-log-manager.c
index c3a91a6..3137931 100644
--- a/tests/dbus/test-log-manager.c
+++ b/tests/dbus/test-log-manager.c
@@ -1,3 +1,5 @@
+#include "config.h"
+
 #include "telepathy-logger/log-manager.c"
 
 #include "lib/util.h"
diff --git a/tests/dbus/test-tpl-log-iter-pidgin.c b/tests/dbus/test-tpl-log-iter-pidgin.c
index e1a96dc..059b32b 100644
--- a/tests/dbus/test-tpl-log-iter-pidgin.c
+++ b/tests/dbus/test-tpl-log-iter-pidgin.c
@@ -1,6 +1,9 @@
+#include "config.h"
+
 #include "lib/simple-account.h"
 #include "lib/util.h"
 
+#include "telepathy-logger/debug-internal.h"
 #include "telepathy-logger/log-iter-internal.h"
 #include "telepathy-logger/log-iter-pidgin-internal.h"
 #include "telepathy-logger/log-store-pidgin-internal.h"
diff --git a/tests/dbus/test-tpl-log-iter-xml.c b/tests/dbus/test-tpl-log-iter-xml.c
index 7b966f6..b01a322 100644
--- a/tests/dbus/test-tpl-log-iter-xml.c
+++ b/tests/dbus/test-tpl-log-iter-xml.c
@@ -1,6 +1,9 @@
+#include "config.h"
+
 #include "lib/util.h"
 
 #include "telepathy-logger/call-event.h"
+#include "telepathy-logger/debug-internal.h"
 #include "telepathy-logger/log-iter-internal.h"
 #include "telepathy-logger/log-iter-xml-internal.h"
 #include "telepathy-logger/log-store-xml-internal.h"
diff --git a/tests/dbus/test-tpl-log-store-pidgin.c b/tests/dbus/test-tpl-log-store-pidgin.c
index fea3daf..a15a87d 100644
--- a/tests/dbus/test-tpl-log-store-pidgin.c
+++ b/tests/dbus/test-tpl-log-store-pidgin.c
@@ -1,3 +1,5 @@
+#include "config.h"
+
 /* FIXME: hugly kludge: we need to include all the declarations which are used
  * by the GInterface and thus not in the -internal.h */
 #include "telepathy-logger/log-store-pidgin.c"
diff --git a/tests/dbus/test-tpl-log-store-xml.c b/tests/dbus/test-tpl-log-store-xml.c
index 6deceb9..35e3178 100644
--- a/tests/dbus/test-tpl-log-store-xml.c
+++ b/tests/dbus/test-tpl-log-store-xml.c
@@ -1,3 +1,5 @@
+#include "config.h"
+
 #include "telepathy-logger/log-store-xml.c"
 
 #include "lib/util.h"
diff --git a/tests/dbus/test-tpl-log-walker.c b/tests/dbus/test-tpl-log-walker.c
index 1ef28dd..b26eb8f 100644
--- a/tests/dbus/test-tpl-log-walker.c
+++ b/tests/dbus/test-tpl-log-walker.c
@@ -1,7 +1,10 @@
+#include "config.h"
+
 #include "lib/simple-account.h"
 #include "lib/util.h"
 
 #include "telepathy-logger/call-event.h"
+#include "telepathy-logger/debug-internal.h"
 #include "telepathy-logger/log-manager.h"
 #include "telepathy-logger/text-event.h"
 
diff --git a/tests/dbus/test-tpl-observer.c b/tests/dbus/test-tpl-observer.c
index aef7ad3..b1c687d 100644
--- a/tests/dbus/test-tpl-observer.c
+++ b/tests/dbus/test-tpl-observer.c
@@ -1,3 +1,5 @@
+#include "config.h"
+
 #include <telepathy-logger/observer-internal.h>
 
 int
diff --git a/tests/lib/simple-account-manager.c b/tests/lib/simple-account-manager.c
index e1d1611..33e70f6 100644
--- a/tests/lib/simple-account-manager.c
+++ b/tests/lib/simple-account-manager.c
@@ -9,6 +9,8 @@
  * notice and this notice are preserved.
  */
 
+#include "config.h"
+
 #include "simple-account-manager.h"
 
 #include <telepathy-glib/gtypes.h>
diff --git a/tests/lib/simple-account.c b/tests/lib/simple-account.c
index 8b25af2..6761c06 100644
--- a/tests/lib/simple-account.c
+++ b/tests/lib/simple-account.c
@@ -8,6 +8,8 @@
  * notice and this notice are preserved.
  */
 
+#include "config.h"
+
 #include "simple-account.h"
 
 #include <telepathy-glib/dbus.h>
diff --git a/tests/test-tpl-conf.c b/tests/test-tpl-conf.c
index 08c00a9..5736356 100644
--- a/tests/test-tpl-conf.c
+++ b/tests/test-tpl-conf.c
@@ -1,3 +1,5 @@
+#include "config.h"
+
 #include <telepathy-logger/conf-internal.h>
 
 int



More information about the telepathy-commits mailing list