diff options
author | Jonathon Jongsma <jjongsma@redhat.com> | 2015-09-23 11:36:01 -0500 |
---|---|---|
committer | Jonathon Jongsma <jjongsma@redhat.com> | 2015-10-09 10:00:56 -0500 |
commit | 9c47d3a39277144b8f3c04113d3a8672af2ed357 (patch) | |
tree | 81d9f52501b3953129d30a3095f0a316b166275d | |
parent | 056f0510a955f1b292567b8a4ab1962b2727da11 (diff) | |
download | spice-gtk-9c47d3a39277144b8f3c04113d3a8672af2ed357.tar.gz spice-gtk-9c47d3a39277144b8f3c04113d3a8672af2ed357.tar.xz spice-gtk-9c47d3a39277144b8f3c04113d3a8672af2ed357.zip |
Don't wrap included headers in G_BEGIN|END_DECLS
Only the local declarations should be declared extern "C", otherwise it
can result in unexpected errors such as this (encountered while re-ordering
some include statements for a different patch):
CC channel-inputs.lo
In file included from /usr/include/glib-2.0/glib/gmacros.h:38:0,
from /usr/lib64/glib-2.0/include/glibconfig.h:9,
from /usr/include/glib-2.0/glib/gtypes.h:32,
from /usr/include/glib-2.0/glib/galloca.h:32,
from /usr/include/glib-2.0/glib.h:30,
from /usr/include/glib-2.0/gobject/gbinding.h:28,
from /usr/include/glib-2.0/glib-object.h:23,
from /usr/include/glib-2.0/gio/gioenums.h:28,
from /usr/include/glib-2.0/gio/giotypes.h:28,
from /usr/include/glib-2.0/gio/gio.h:26,
from ../../src/spice-channel.h:27,
from ../../src/channel-inputs.h:25,
from ../../src/channel-inputs.c:20:
/usr/lib/gcc/x86_64-redhat-linux/4.9.2/include/stddef.h:147:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'typedef'
typedef __PTRDIFF_TYPE__ ptrdiff_t;
^
-rw-r--r-- | src/smartcard-manager.h | 4 | ||||
-rw-r--r-- | src/spice-channel.h | 5 | ||||
-rw-r--r-- | src/spice-widget-priv.h | 4 |
3 files changed, 7 insertions, 6 deletions
diff --git a/src/smartcard-manager.h b/src/smartcard-manager.h index f74098f..e4a6277 100644 --- a/src/smartcard-manager.h +++ b/src/smartcard-manager.h @@ -22,11 +22,11 @@ #warning "Only <spice-client.h> can be included directly" #endif -G_BEGIN_DECLS - #include "spice-types.h" #include "spice-util.h" +G_BEGIN_DECLS + #define SPICE_TYPE_SMARTCARD_MANAGER (spice_smartcard_manager_get_type ()) #define SPICE_SMARTCARD_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SPICE_TYPE_SMARTCARD_MANAGER, SpiceSmartcardManager)) #define SPICE_SMARTCARD_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SPICE_TYPE_SMARTCARD_MANAGER, SpiceSmartcardManagerClass)) diff --git a/src/spice-channel.h b/src/spice-channel.h index da31843..3b0bffb 100644 --- a/src/spice-channel.h +++ b/src/spice-channel.h @@ -22,13 +22,14 @@ #warning "Only <spice-client.h> can be included directly" #endif -G_BEGIN_DECLS - #include <gio/gio.h> + #include "spice-types.h" #include "spice-glib-enums.h" #include "spice-util.h" +G_BEGIN_DECLS + #define SPICE_TYPE_CHANNEL (spice_channel_get_type ()) #define SPICE_CHANNEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SPICE_TYPE_CHANNEL, SpiceChannel)) #define SPICE_CHANNEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SPICE_TYPE_CHANNEL, SpiceChannelClass)) diff --git a/src/spice-widget-priv.h b/src/spice-widget-priv.h index 0e1f661..682e889 100644 --- a/src/spice-widget-priv.h +++ b/src/spice-widget-priv.h @@ -18,8 +18,6 @@ #ifndef __SPICE_WIDGET_PRIV_H__ #define __SPICE_WIDGET_PRIV_H__ -G_BEGIN_DECLS - #include "config.h" #ifdef WITH_X11 @@ -36,6 +34,8 @@ G_BEGIN_DECLS #include "spice-common.h" #include "spice-gtk-session.h" +G_BEGIN_DECLS + #define SPICE_DISPLAY_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE((obj), SPICE_TYPE_DISPLAY, SpiceDisplayPrivate)) |