[pan/wip/smcv/no-headers-in-extern-c: 2/2] Move more header inclusions outside extern "C"




commit 2037641c882c98cebda8052d987cc548708082fd
Author: Simon McVittie <smcv debian org>
Date:   Tue Aug 17 10:55:37 2021 +0100

    Move more header inclusions outside extern "C"
    
    GLib/GObject/GIO, GTK, GMime, Enchant, Zlib and the bundled uulib
    library are all well-behaved/C++-friendly C libraries that provide
    extern "C" wrappers in their header files, either directly or via
    GLib's G_BEGIN_DECLS/G_END_DECLS macros. As a result, there is no need
    to wrap their header inclusions in a redundant extern "C" block.
    
    The redundant extern "C" can be harmful in some cases, where an otherwise
    C-based library detects that its headers are being compiled as C++ via
    the __cplusplus macro and changes its compile-time behaviour accordingly.
    In particular, GLib 2.68 uses C++ features to implement the glib_typeof
    macro where available, so that it can make macros like g_object_ref()
    more type-safe. This results in GLib headers failing to compile when
    wrapped in a redundant extern "C" block.
    
    On glibc-based systems (and probably every other reasonable Unix
    implementation), the Standard C library headers also do not require
    wrapping in an extern "C" block, but it might be the case that there
    are older Unix systems where the extern "C" block is required. I have
    not moved those header inclusions outside extern "C" in this commit,
    although perhaps they should be.
    
    Resolves: https://gitlab.gnome.org/GNOME/pan/-/issues/128
    Signed-off-by: Simon McVittie <smcv debian org>

 pan/data-impl/data-impl.cc       |  4 +---
 pan/data-impl/xover.cc           |  6 ++----
 pan/data/article-cache.cc        |  4 ++--
 pan/data/encode-cache.cc         |  4 ++--
 pan/general/line-reader.cc       |  4 +---
 pan/general/utf8-utils.cc        |  2 --
 pan/gui/actions.cc               |  6 ++----
 pan/gui/body-pane.cc             |  8 +++-----
 pan/gui/dl-headers-ui.cc         |  4 +---
 pan/gui/group-pane.cc            |  6 ++----
 pan/gui/group-prefs-dialog.cc    |  6 ++----
 pan/gui/gui.cc                   |  2 +-
 pan/gui/header-pane.cc           |  9 +++------
 pan/gui/log-ui.cc                |  6 ++----
 pan/gui/pan-file-entry.cc        |  6 ++----
 pan/gui/pan.cc                   | 11 ++++++-----
 pan/gui/post-ui.cc               |  8 ++++----
 pan/gui/prefs-ui.cc              |  6 ++----
 pan/gui/profiles-dialog.cc       |  6 ++----
 pan/gui/progress-view.cc         |  4 +---
 pan/gui/save-attach-ui.cc        |  6 ++----
 pan/gui/save-ui.cc               |  6 ++----
 pan/gui/score-add-ui.cc          |  4 +---
 pan/gui/score-view-ui.cc         |  6 ++----
 pan/gui/server-ui.cc             |  4 +---
 pan/gui/task-pane.cc             |  4 +---
 pan/tasks/decoder.cc             |  8 +++-----
 pan/tasks/decoder.h              |  6 ++----
 pan/tasks/encoder.cc             |  2 +-
 pan/tasks/encoder.h              |  8 +++-----
 pan/tasks/socket-impl-gio.cc     |  2 +-
 pan/tasks/socket-impl-openssl.cc |  2 +-
 pan/tasks/task-article.cc        |  5 +----
 pan/tasks/task-groups.cc         |  2 +-
 pan/tasks/task-post.cc           |  4 +---
 pan/tasks/task-upload.h          | 10 ++++------
 pan/tasks/task-xover.cc          |  7 +++----
 pan/tasks/task-xoverinfo.cc      | 10 +++++-----
 pan/usenet-utils/gnksa.cc        |  2 +-
 pan/usenet-utils/gpg.cc          |  5 +++--
 pan/usenet-utils/mime-utils.cc   |  2 +-
 pan/usenet-utils/scorefile.cc    |  4 +---
 pan/usenet-utils/ssl-utils.h     |  4 +---
 43 files changed, 83 insertions(+), 142 deletions(-)
---
diff --git a/pan/data-impl/data-impl.cc b/pan/data-impl/data-impl.cc
index 215be61b..44659665 100644
--- a/pan/data-impl/data-impl.cc
+++ b/pan/data-impl/data-impl.cc
@@ -22,9 +22,7 @@
 **************/
 
 #include <config.h>
-extern "C" {
-  #include <glib/gi18n.h>
-}
+#include <glib/gi18n.h>
 #include <glib.h> // for g_build_filename
 #include <pan/general/debug.h>
 #include <pan/general/file-util.h>
diff --git a/pan/data-impl/xover.cc b/pan/data-impl/xover.cc
index ff8644f1..a1995564 100644
--- a/pan/data-impl/xover.cc
+++ b/pan/data-impl/xover.cc
@@ -20,10 +20,8 @@
 #include <config.h>
 #include <cmath>
 #include <fstream>
-extern "C" {
-  #include <glib/gi18n.h>
-  #include <gmime/gmime.h>
-}
+#include <glib/gi18n.h>
+#include <gmime/gmime.h>
 #include <pan/general/debug.h>
 #include <pan/general/log.h>
 #include <pan/general/macros.h>
diff --git a/pan/data/article-cache.cc b/pan/data/article-cache.cc
index 2b973440..2130f2dd 100644
--- a/pan/data/article-cache.cc
+++ b/pan/data/article-cache.cc
@@ -26,9 +26,9 @@ extern "C"
   #include <sys/stat.h>
   #include <unistd.h>
   #include <dirent.h>
-
-  #include <gmime/gmime.h>
 }
+
+#include <gmime/gmime.h>
 #include <glib.h>
 #include <glib/gi18n.h>
 
diff --git a/pan/data/encode-cache.cc b/pan/data/encode-cache.cc
index eecd1d19..d66ec5ab 100644
--- a/pan/data/encode-cache.cc
+++ b/pan/data/encode-cache.cc
@@ -28,9 +28,9 @@ extern "C"
   #include <sys/stat.h>
   #include <unistd.h>
   #include <dirent.h>
-
-  #include <gmime/gmime.h>
 }
+
+#include <gmime/gmime.h>
 #include <glib.h>
 #include <glib/gi18n.h>
 
diff --git a/pan/general/line-reader.cc b/pan/general/line-reader.cc
index afb9be80..6b80fc48 100644
--- a/pan/general/line-reader.cc
+++ b/pan/general/line-reader.cc
@@ -1,9 +1,7 @@
 #include <config.h>
 #include <cstdio>
 #include <cstdlib>
-extern "C"{ 
-  #include <glib/gi18n.h>
-}
+#include <glib/gi18n.h>
 #include <cerrno>
 #include "file-util.h"
 #include "line-reader.h"
diff --git a/pan/general/utf8-utils.cc b/pan/general/utf8-utils.cc
index be79a13b..fea6100d 100644
--- a/pan/general/utf8-utils.cc
+++ b/pan/general/utf8-utils.cc
@@ -21,9 +21,7 @@
 #include <string>
 #include <vector>
 #include <string.h>
-extern "C" {
 #include <glib/gi18n.h>
-}
 #include <locale.h>
 #include <gmime/gmime.h>
 #include <pan/general/debug.h>
diff --git a/pan/gui/actions.cc b/pan/gui/actions.cc
index 520c08b0..453a53df 100644
--- a/pan/gui/actions.cc
+++ b/pan/gui/actions.cc
@@ -18,10 +18,8 @@
  */
 
 #include <config.h>
-extern "C" {
-  #include <glib/gi18n.h>
-  #include "gtk-compat.h"
-}
+#include <glib/gi18n.h>
+#include "gtk-compat.h"
 
 #include <pan/general/macros.h>
 #include <pan/general/debug.h>
diff --git a/pan/gui/body-pane.cc b/pan/gui/body-pane.cc
index 53e9124a..83c44eec 100644
--- a/pan/gui/body-pane.cc
+++ b/pan/gui/body-pane.cc
@@ -22,11 +22,9 @@
 #include <cmath>
 #include <iostream>
 #include <sstream>
-extern "C" {
-  #include <glib/gi18n.h>
-  #include "gtk-compat.h"
-  #include <gmime/gmime.h>
-}
+#include <glib/gi18n.h>
+#include "gtk-compat.h"
+#include <gmime/gmime.h>
 #include <gdk-pixbuf/gdk-pixbuf.h>
 #include <pan/general/debug.h>
 #include <pan/general/log.h>
diff --git a/pan/gui/dl-headers-ui.cc b/pan/gui/dl-headers-ui.cc
index cfc536d5..e9f4b2dc 100644
--- a/pan/gui/dl-headers-ui.cc
+++ b/pan/gui/dl-headers-ui.cc
@@ -20,9 +20,7 @@
 #include <config.h>
 #include <glib.h>
 #include <glib/gi18n.h>
-extern "C" {
-  #include "gtk-compat.h"
-}
+#include "gtk-compat.h"
 #include <pan/general/macros.h>
 #include <pan/tasks/queue.h>
 #include <pan/tasks/task-xover.h>
diff --git a/pan/gui/group-pane.cc b/pan/gui/group-pane.cc
index 28ad5818..e4ac62ed 100644
--- a/pan/gui/group-pane.cc
+++ b/pan/gui/group-pane.cc
@@ -20,10 +20,8 @@
 #include <config.h>
 #include <cassert>
 #include <deque>
-extern "C" {
-  #include <glib/gi18n.h>
-  #include "gtk-compat.h"
-}
+#include <glib/gi18n.h>
+#include "gtk-compat.h"
 #include <pan/general/debug.h>
 //#include <pan/general/gdk-threads.h>
 #include <pan/general/log.h>
diff --git a/pan/gui/group-prefs-dialog.cc b/pan/gui/group-prefs-dialog.cc
index 69837469..2ec5c844 100644
--- a/pan/gui/group-prefs-dialog.cc
+++ b/pan/gui/group-prefs-dialog.cc
@@ -20,12 +20,10 @@
 #include <config.h>
 #include <glib/gi18n.h>
 #include <glib.h>
-extern "C" {
-  #include "gtk-compat.h"
+#include "gtk-compat.h"
 #ifdef HAVE_GTKSPELL
-  #include <enchant/enchant.h>
+#include <enchant/enchant.h>
 #endif
-}
 #include <pan/general/debug.h>
 #include <pan/general/macros.h>
 #include <pan/data/data.h>
diff --git a/pan/gui/gui.cc b/pan/gui/gui.cc
index f79aa1ea..9f8787e3 100644
--- a/pan/gui/gui.cc
+++ b/pan/gui/gui.cc
@@ -25,9 +25,9 @@
 extern "C" {
   #include <sys/types.h> // for chmod
   #include <sys/stat.h> // for chmod
-  #include <glib/gi18n.h>
   #include <dirent.h>
 }
+#include <glib/gi18n.h>
 #include <pan/general/debug.h>
 #include <pan/general/e-util.h>
 #include <pan/general/file-util.h>
diff --git a/pan/gui/header-pane.cc b/pan/gui/header-pane.cc
index dc65a77b..f9a4cb04 100644
--- a/pan/gui/header-pane.cc
+++ b/pan/gui/header-pane.cc
@@ -17,12 +17,9 @@
  *
  */
 
-extern "C" {
-  #include <config.h>
-  #include <glib/gi18n.h>
-  #include "gtk-compat.h"
-  #include "gtk-compat.h"
-}
+#include <config.h>
+#include <glib/gi18n.h>
+#include "gtk-compat.h"
 #include <cctype>
 #include <cmath>
 #include <algorithm>
diff --git a/pan/gui/log-ui.cc b/pan/gui/log-ui.cc
index 7b114937..8846e1d9 100644
--- a/pan/gui/log-ui.cc
+++ b/pan/gui/log-ui.cc
@@ -21,10 +21,8 @@
 #include <ostream>
 #include <fstream>
 #include <iostream>
-extern "C" {
-  #include <glib/gi18n.h>
-  #include "gtk-compat.h"
-}
+#include <glib/gi18n.h>
+#include "gtk-compat.h"
 #include <pan/general/log.h>
 #include <pan/general/macros.h>
 #include <pan/general/string-view.h>
diff --git a/pan/gui/pan-file-entry.cc b/pan/gui/pan-file-entry.cc
index 705fc913..f86c8450 100644
--- a/pan/gui/pan-file-entry.cc
+++ b/pan/gui/pan-file-entry.cc
@@ -19,10 +19,8 @@
 
 #include <config.h>
 #include <string>
-extern "C" {
-  #include <glib/gi18n.h>
-  #include "gtk-compat.h"
-}
+#include <glib/gi18n.h>
+#include "gtk-compat.h"
 #include <pan/general/file-util.h>
 #include "pad.h"
 #include "pan-file-entry.h"
diff --git a/pan/gui/pan.cc b/pan/gui/pan.cc
index fb3a6968..3eb4214f 100644
--- a/pan/gui/pan.cc
+++ b/pan/gui/pan.cc
@@ -22,18 +22,19 @@
 #include <fstream>
 #include <config.h>
 #include <signal.h>
+#include <glib/gi18n.h>
+#include "gtk-compat.h"
+#include <gmime/gmime.h>
+#include <gio/gio.h>
 
 extern "C" {
-  #include <glib/gi18n.h>
-  #include "gtk-compat.h"
-  #include <gmime/gmime.h>
-  #include <gio/gio.h>
   #include <sys/types.h>
   #include <sys/stat.h>
   #include <unistd.h>
-  #include <uulib/crc32.h>
 }
 
+#include <uulib/crc32.h>
+
 #ifdef G_OS_WIN32
   #undef _WIN32_WINNT
   #define _WIN32_WINNT 0x0501
diff --git a/pan/gui/post-ui.cc b/pan/gui/post-ui.cc
index 8769ec54..060f7227 100644
--- a/pan/gui/post-ui.cc
+++ b/pan/gui/post-ui.cc
@@ -22,15 +22,15 @@
 #include <iostream>
 #include <sstream>
 #include <unistd.h>
+#include <gmime/gmime.h>
+#include <glib/gi18n.h>
+#include "gtk-compat.h"
 extern "C" {
-  #include <gmime/gmime.h>
-  #include <glib/gi18n.h>
-  #include "gtk-compat.h"
   #include <sys/time.h>
+}
 #ifdef HAVE_GTKSPELL
   #include <gtkspell/gtkspell.h>
 #endif
-}
 #include <pan/data/data.h>
 #include <pan/general/debug.h>
 #include <pan/general/file-util.h>
diff --git a/pan/gui/prefs-ui.cc b/pan/gui/prefs-ui.cc
index f7dc0f08..da0a013b 100644
--- a/pan/gui/prefs-ui.cc
+++ b/pan/gui/prefs-ui.cc
@@ -18,10 +18,8 @@
  */
 
 #include <config.h>
-extern "C" {
-  #include <glib/gi18n.h>
-  #include "gtk-compat.h"
-}
+#include <glib/gi18n.h>
+#include "gtk-compat.h"
 #include <pan/general/debug.h>
 #include <pan/general/macros.h>
 #include <pan/general/file-util.h>
diff --git a/pan/gui/profiles-dialog.cc b/pan/gui/profiles-dialog.cc
index 26ff029e..cf946955 100644
--- a/pan/gui/profiles-dialog.cc
+++ b/pan/gui/profiles-dialog.cc
@@ -23,10 +23,8 @@
 
 #include <config.h>
 #include <iostream>
-extern "C" {
-  #include <glib/gi18n.h>
-  #include "gtk-compat.h"
-}
+#include <glib/gi18n.h>
+#include "gtk-compat.h"
 #include <pan/general/debug.h>
 #include <pan/general/macros.h>
 #include <pan/usenet-utils/gnksa.h>
diff --git a/pan/gui/progress-view.cc b/pan/gui/progress-view.cc
index 241ad1cb..43ef4f20 100644
--- a/pan/gui/progress-view.cc
+++ b/pan/gui/progress-view.cc
@@ -18,9 +18,7 @@
  */
 
 #include <config.h>
-extern "C" {
-  #include "gtk-compat.h"
-}
+#include "gtk-compat.h"
 #include <pan/general/string-view.h>
 #include <pan/usenet-utils/mime-utils.h>
 #include "progress-view.h"
diff --git a/pan/gui/save-attach-ui.cc b/pan/gui/save-attach-ui.cc
index 0b08b6f1..7082ab81 100644
--- a/pan/gui/save-attach-ui.cc
+++ b/pan/gui/save-attach-ui.cc
@@ -18,10 +18,8 @@
  */
 
 #include <config.h>
-extern "C" {
-  #include <glib/gi18n.h>
-  #include "gtk-compat.h"
-}
+#include <glib/gi18n.h>
+#include "gtk-compat.h"
 #include <pan/general/debug.h>
 #include <pan/general/macros.h>
 #include <pan/icons/pan-pixbufs.h>
diff --git a/pan/gui/save-ui.cc b/pan/gui/save-ui.cc
index 0f034e5c..ffa4adb8 100644
--- a/pan/gui/save-ui.cc
+++ b/pan/gui/save-ui.cc
@@ -18,10 +18,8 @@
  */
 
 #include <config.h>
-extern "C" {
-  #include <glib/gi18n.h>
-  #include "gtk-compat.h"
-}
+#include <glib/gi18n.h>
+#include "gtk-compat.h"
 #include <pan/general/debug.h>
 #include <pan/general/macros.h>
 #include <pan/icons/pan-pixbufs.h>
diff --git a/pan/gui/score-add-ui.cc b/pan/gui/score-add-ui.cc
index e72bdb5c..3b811672 100644
--- a/pan/gui/score-add-ui.cc
+++ b/pan/gui/score-add-ui.cc
@@ -20,9 +20,7 @@
 #include <config.h>
 #include <cassert>
 #include <climits>
-extern "C" {
-  #include <glib/gi18n.h>
-}
+#include <glib/gi18n.h>
 #include <pan/general/debug.h>
 #include <pan/general/text-match.h>
 #include "hig.h"
diff --git a/pan/gui/score-view-ui.cc b/pan/gui/score-view-ui.cc
index d6c81c12..4c8b7689 100644
--- a/pan/gui/score-view-ui.cc
+++ b/pan/gui/score-view-ui.cc
@@ -18,10 +18,8 @@
  */
 
 #include <config.h>
-extern "C" {
-  #include <glib/gi18n.h>
-  #include "gtk-compat.h"
-}
+#include <glib/gi18n.h>
+#include "gtk-compat.h"
 #include <pan/general/debug.h>
 #include "pad.h"
 #include "score-add-ui.h"
diff --git a/pan/gui/server-ui.cc b/pan/gui/server-ui.cc
index 684ea0c4..268114b4 100644
--- a/pan/gui/server-ui.cc
+++ b/pan/gui/server-ui.cc
@@ -23,9 +23,7 @@
 #include <climits>
 #include <glib.h>
 #include <glib/gi18n.h>
-extern "C" {
-  #include "gtk-compat.h"
-}
+#include "gtk-compat.h"
 
 #include <pan/icons/pan-pixbufs.h>
 #include <pan/general/file-util.h>
diff --git a/pan/gui/task-pane.cc b/pan/gui/task-pane.cc
index 1c302f92..18a8f74d 100644
--- a/pan/gui/task-pane.cc
+++ b/pan/gui/task-pane.cc
@@ -20,9 +20,7 @@
 #include <config.h>
 #include <glib.h>
 #include <glib/gi18n.h>
-extern "C" {
-  #include "gtk-compat.h"
-}
+#include "gtk-compat.h"
 #include <pan/general/e-util.h>
 #include <pan/general/debug.h>
 #include <pan/general/file-util.h>
diff --git a/pan/tasks/decoder.cc b/pan/tasks/decoder.cc
index b4c21ae0..bdfe7cc7 100644
--- a/pan/tasks/decoder.cc
+++ b/pan/tasks/decoder.cc
@@ -25,11 +25,9 @@
 #include <cerrno>
 #include <ostream>
 #include <fstream>
-extern "C" {
-#  define PROTOTYPES
-#  include <uulib/uudeview.h>
-#  include <glib/gi18n.h>
-};
+#define PROTOTYPES
+#include <uulib/uudeview.h>
+#include <glib/gi18n.h>
 #include <pan/general/worker-pool.h>
 #include <pan/general/debug.h>
 #include <pan/general/file-util.h>
diff --git a/pan/tasks/decoder.h b/pan/tasks/decoder.h
index 74403c16..c5653e46 100644
--- a/pan/tasks/decoder.h
+++ b/pan/tasks/decoder.h
@@ -30,10 +30,8 @@
 #include <pan/general/locking.h>
 #include <pan/general/worker-pool.h>
 #include <pan/tasks/task-article.h>
-extern "C" {
-#  define PROTOTYPES
-#  include <uulib/uudeview.h>
-};
+#define PROTOTYPES
+#include <uulib/uudeview.h>
 
 namespace pan
 {
diff --git a/pan/tasks/encoder.cc b/pan/tasks/encoder.cc
index 7960b849..fad9a632 100644
--- a/pan/tasks/encoder.cc
+++ b/pan/tasks/encoder.cc
@@ -28,10 +28,10 @@
 #include <fstream>
 #include <sstream>
 
-extern "C" {
 #define PROTOTYPES
 #include <uulib/uudeview.h>
 #include <glib/gi18n.h>
+extern "C" {
 #include <sys/time.h>
 };
 
diff --git a/pan/tasks/encoder.h b/pan/tasks/encoder.h
index a547ffe0..12d2a8ce 100644
--- a/pan/tasks/encoder.h
+++ b/pan/tasks/encoder.h
@@ -32,11 +32,9 @@
 #include <pan/general/worker-pool.h>
 #include <pan/tasks/task-upload.h>
 
-extern "C" {
-#  define PROTOTYPES
-#  include <uulib/uudeview.h>
-#  include <uulib/crc32.h>
-};
+#define PROTOTYPES
+#include <uulib/uudeview.h>
+#include <uulib/crc32.h>
 
 namespace pan
 {
diff --git a/pan/tasks/socket-impl-gio.cc b/pan/tasks/socket-impl-gio.cc
index d3339dd2..7dc2ec1a 100644
--- a/pan/tasks/socket-impl-gio.cc
+++ b/pan/tasks/socket-impl-gio.cc
@@ -31,9 +31,9 @@
 
 extern "C" {
   #include <unistd.h>
-  #include <glib/gi18n.h>
 }
 
+#include <glib/gi18n.h>
 #include <pan/general/file-util.h>
 #include <pan/general/log.h>
 #include <pan/general/macros.h>
diff --git a/pan/tasks/socket-impl-openssl.cc b/pan/tasks/socket-impl-openssl.cc
index b58e0749..d08b9520 100644
--- a/pan/tasks/socket-impl-openssl.cc
+++ b/pan/tasks/socket-impl-openssl.cc
@@ -34,13 +34,13 @@
 
 extern "C" {
   #include <unistd.h>
-  #include <glib/gi18n.h>
   #include <errno.h>
   #include <fcntl.h>
   #include <sys/time.h>
   #include <sys/types.h>
 }
 
+#include <glib/gi18n.h>
 #include <pan/usenet-utils/ssl-utils.h>
 #include <pan/general/file-util.h>
 #include <pan/general/log.h>
diff --git a/pan/tasks/task-article.cc b/pan/tasks/task-article.cc
index 9c96b7d1..1dc17baa 100644
--- a/pan/tasks/task-article.cc
+++ b/pan/tasks/task-article.cc
@@ -24,10 +24,7 @@
 #include <config.h>
 #include <algorithm>
 #include <cassert>
-extern "C"
-{
-  #include <glib/gi18n.h>
-}
+#include <glib/gi18n.h>
 #include <pan/general/debug.h>
 #include <pan/general/file-util.h>
 #include <pan/general/utf8-utils.h>
diff --git a/pan/tasks/task-groups.cc b/pan/tasks/task-groups.cc
index b8618d67..c455808e 100644
--- a/pan/tasks/task-groups.cc
+++ b/pan/tasks/task-groups.cc
@@ -19,8 +19,8 @@
 
 #include <config.h>
 #include <cassert>
+#include <glib/gi18n.h>
 extern "C" {
-  #include <glib/gi18n.h>
   #include <stdlib.h>
 }
 #include <pan/general/debug.h>
diff --git a/pan/tasks/task-post.cc b/pan/tasks/task-post.cc
index bb80fb96..4ab9c2f4 100644
--- a/pan/tasks/task-post.cc
+++ b/pan/tasks/task-post.cc
@@ -18,9 +18,7 @@
  */
 
 #include <config.h>
-extern "C" {
-  #include <glib/gi18n.h>
-}
+#include <glib/gi18n.h>
 #include "task-post.h"
 #include <pan/general/debug.h>
 #include <pan/general/log.h>
diff --git a/pan/tasks/task-upload.h b/pan/tasks/task-upload.h
index 7bd4fe02..f6803166 100644
--- a/pan/tasks/task-upload.h
+++ b/pan/tasks/task-upload.h
@@ -34,12 +34,10 @@
 #include <pan/tasks/nntp.h>
 #include <pan/tasks/task.h>
 
-extern "C" {
-  #define PROTOTYPES
-  #include <uulib/uudeview.h>
-  #include <gmime/gmime.h>
-  #include <glib/gi18n.h>
-};
+#define PROTOTYPES
+#include <uulib/uudeview.h>
+#include <gmime/gmime.h>
+#include <glib/gi18n.h>
 
 #include <set>
 
diff --git a/pan/tasks/task-xover.cc b/pan/tasks/task-xover.cc
index c3c82608..8835503a 100644
--- a/pan/tasks/task-xover.cc
+++ b/pan/tasks/task-xover.cc
@@ -21,14 +21,13 @@
 #include <cassert>
 #include <cerrno>
 
-extern "C"
-{
-#define PROTOTYPES
+extern "C" {
 #include <stdio.h>
+}
+#define PROTOTYPES
 #include <uulib/uudeview.h>
 #include <glib/gi18n.h>
 #include <gmime/gmime-utils.h>
-}
 
 #include <fstream>
 #include <iostream>
diff --git a/pan/tasks/task-xoverinfo.cc b/pan/tasks/task-xoverinfo.cc
index c598bf8d..210b9bd5 100644
--- a/pan/tasks/task-xoverinfo.cc
+++ b/pan/tasks/task-xoverinfo.cc
@@ -21,13 +21,13 @@
 #include <cassert>
 #include <cerrno>
 extern "C" {
-  #define PROTOTYPES
   #include <stdio.h>
-  #include <uulib/uudeview.h>
-  #include <glib/gi18n.h>
-  #include <gmime/gmime-utils.h>
-  #include <zlib.h>
 }
+#define PROTOTYPES
+#include <uulib/uudeview.h>
+#include <glib/gi18n.h>
+#include <gmime/gmime-utils.h>
+#include <zlib.h>
 #include <fstream>
 #include <iostream>
 #include <pan/general/debug.h>
diff --git a/pan/usenet-utils/gnksa.cc b/pan/usenet-utils/gnksa.cc
index db1f2c44..fb888d5d 100644
--- a/pan/usenet-utils/gnksa.cc
+++ b/pan/usenet-utils/gnksa.cc
@@ -37,10 +37,10 @@ extern "C"
 {
   #include <ctype.h>
   #include <unistd.h>
-  #include <glib/gi18n.h>
   #include <sys/time.h>
 }
 
+#include <glib/gi18n.h>
 #include <pan/general/debug.h>
 #include <pan/general/macros.h>
 #include <pan/general/log.h>
diff --git a/pan/usenet-utils/gpg.cc b/pan/usenet-utils/gpg.cc
index 4df4525f..0c3ae145 100644
--- a/pan/usenet-utils/gpg.cc
+++ b/pan/usenet-utils/gpg.cc
@@ -28,10 +28,11 @@ extern "C" {
   #include <stdlib.h>
   #include <unistd.h>
   #include <string.h>
-  #include <glib/gi18n.h>
-  #include <gmime/gmime.h>
 }
 
+#include <glib/gi18n.h>
+#include <gmime/gmime.h>
+
 #ifdef HAVE_GMIME_CRYPTO
 
 namespace pan
diff --git a/pan/usenet-utils/mime-utils.cc b/pan/usenet-utils/mime-utils.cc
index 881df7b4..5e185dbd 100644
--- a/pan/usenet-utils/mime-utils.cc
+++ b/pan/usenet-utils/mime-utils.cc
@@ -26,8 +26,8 @@
 extern "C"
 {
   #include <unistd.h>
-  #include <gmime/gmime.h>
 }
+#include <gmime/gmime.h>
 #include <pan/general/debug.h>
 #include <pan/general/macros.h>
 #include <pan/general/messages.h>
diff --git a/pan/usenet-utils/scorefile.cc b/pan/usenet-utils/scorefile.cc
index 8b56a2a9..4b151f0c 100644
--- a/pan/usenet-utils/scorefile.cc
+++ b/pan/usenet-utils/scorefile.cc
@@ -23,9 +23,7 @@
 #include <iostream>
 #include <sstream>
 #include <string>
-extern "C" {
-  #include <glib/gi18n.h>
-}
+#include <glib/gi18n.h>
 #include <pan/general/debug.h>
 #include <pan/general/log.h>
 #include <pan/general/macros.h>
diff --git a/pan/usenet-utils/ssl-utils.h b/pan/usenet-utils/ssl-utils.h
index 2286250f..0beb32f2 100644
--- a/pan/usenet-utils/ssl-utils.h
+++ b/pan/usenet-utils/ssl-utils.h
@@ -43,9 +43,7 @@
 #include <map>
 #include <sstream>
 #include <iostream>
-extern "C" {
-  #include <glib/gi18n.h>
-}
+#include <glib/gi18n.h>
 
 namespace pan
 {


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