From 521b6f544e23dc43028b938e0c3d6e1618acdd7a Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Thu, 5 Jun 2008 09:03:47 +0000 Subject: [PATCH] add G_DISABLE_SINGLE_INCLUDES and ATK_DISABLE_SINGLE_INCLUDES to CPPFLAGS. 2008-06-05 Michael Natterer * configure.in: add G_DISABLE_SINGLE_INCLUDES and ATK_DISABLE_SINGLE_INCLUDES to CPPFLAGS. * atk/atk.h: define __ATK_H_INSIDE__ around including all other headers. * atk/atk*.h: add single-include guards that #error out if ATK_DISABLE_SINGLE_INCLUDES is defined and any of these files is included individually. Use G_BEGIN_DECLS/G_END_DECLS in all files. * atk/Makefile.am: define ATK_COMPILATION while building ATK. Add single-include guards to the generated atk-enum-types.h too. svn path=/trunk/; revision=1246 --- ChangeLog | 15 +++++++++++++++ atk/Makefile.am | 3 ++- atk/atk.h | 4 ++++ atk/atkaction.h | 13 ++++++------- atk/atkcomponent.h | 12 ++++++------ atk/atkdocument.h | 14 ++++++++------ atk/atkeditabletext.h | 13 ++++++------- atk/atkgobjectaccessible.h | 14 ++++++-------- atk/atkhyperlink.h | 16 +++++++--------- atk/atkhyperlinkimpl.h | 13 ++++++------- atk/atkhypertext.h | 14 ++++++-------- atk/atkimage.h | 13 +++++++------ atk/atkmisc.h | 13 ++++++------- atk/atknoopobject.h | 4 ++++ atk/atknoopobjectfactory.h | 13 ++++++------- atk/atkobject.h | 15 +++++++-------- atk/atkobjectfactory.h | 13 ++++++------- atk/atkregistry.h | 14 +++++++------- atk/atkrelation.h | 13 ++++++------- atk/atkrelationset.h | 13 ++++++------- atk/atkrelationtype.h | 14 ++++++++------ atk/atkselection.h | 13 ++++++------- atk/atkstate.h | 14 +++++++------- atk/atkstateset.h | 15 +++++++-------- atk/atkstreamablecontent.h | 14 ++++++-------- atk/atktable.h | 13 ++++++------- atk/atktext.h | 12 +++++------- atk/atkutil.h | 14 ++++++-------- atk/atkvalue.h | 14 ++++++-------- configure.in | 2 ++ 30 files changed, 186 insertions(+), 181 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9c8cf11..ab489e5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2008-06-05 Michael Natterer + + * configure.in: add G_DISABLE_SINGLE_INCLUDES and + ATK_DISABLE_SINGLE_INCLUDES to CPPFLAGS. + + * atk/atk.h: define __ATK_H_INSIDE__ around including all other + headers. + + * atk/atk*.h: add single-include guards that #error out if + ATK_DISABLE_SINGLE_INCLUDES is defined and any of these files is + included individually. Use G_BEGIN_DECLS/G_END_DECLS in all files. + + * atk/Makefile.am: define ATK_COMPILATION while building ATK. + Add single-include guards to the generated atk-enum-types.h too. + 2008-03-10 Li Yuan * NEWS: diff --git a/atk/Makefile.am b/atk/Makefile.am index f243d38..7bb3155 100644 --- a/atk/Makefile.am +++ b/atk/Makefile.am @@ -11,6 +11,7 @@ endif INCLUDES = \ -I$(top_srcdir) \ -DG_DISABLE_DEPRECATED \ + -DATK_COMPILATION \ -DATK_LOCALEDIR="\"$(datadir)/locale\"" \ $(DEP_CFLAGS) @@ -109,7 +110,7 @@ atk-enum-types.h: s-enum-types-h @true s-enum-types-h: @REBUILD@ $(atk_headers) Makefile ( cd $(srcdir) && $(GLIB_MKENUMS) \ - --fhead "#ifndef __ATK_ENUM_TYPES_H__\n#define __ATK_ENUM_TYPES_H__\n\n#include \n\nG_BEGIN_DECLS\n" \ + --fhead "#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (ATK_COMPILATION)\n#error \"Only can be included directly.\"\n#endif\n\n#ifndef __ATK_ENUM_TYPES_H__\n#define __ATK_ENUM_TYPES_H__\n\n#include \n\nG_BEGIN_DECLS\n" \ --fprod "/* enumerations from \"@filename@\" */\n" \ --vhead "GType @enum_name@_get_type (void);\n#define ATK_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n" \ --ftail "G_END_DECLS\n\n#endif /* __ATK_ENUM_TYPES_H__ */" \ diff --git a/atk/atk.h b/atk/atk.h index 04d9539..a7536a0 100755 --- a/atk/atk.h +++ b/atk/atk.h @@ -20,6 +20,8 @@ #ifndef __ATK_H__ #define __ATK_H__ +#define __ATK_H_INSIDE__ + #include #include #include @@ -47,4 +49,6 @@ #include #include +#undef __ATK_H_INSIDE__ + #endif /* __ATK_H__ */ diff --git a/atk/atkaction.h b/atk/atkaction.h index 8dfee9f..45d74b8 100755 --- a/atk/atkaction.h +++ b/atk/atkaction.h @@ -17,14 +17,16 @@ * Boston, MA 02111-1307, USA. */ +#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (ATK_COMPILATION) +#error "Only can be included directly." +#endif + #ifndef __ATK_ACTION_H__ #define __ATK_ACTION_H__ #include -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ +G_BEGIN_DECLS /* * The interface AtkAction should be supported by any object that can @@ -104,9 +106,6 @@ G_CONST_RETURN gchar* atk_action_get_localized_name (AtkAction *action, * (an accessible action, or the list of actions, has changed) */ -#ifdef __cplusplus -} -#endif /* __cplusplus */ - +G_END_DECLS #endif /* __ATK_ACTION_H__ */ diff --git a/atk/atkcomponent.h b/atk/atkcomponent.h index c72a728..cf6dc9f 100755 --- a/atk/atkcomponent.h +++ b/atk/atkcomponent.h @@ -17,15 +17,17 @@ * Boston, MA 02111-1307, USA. */ +#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (ATK_COMPILATION) +#error "Only can be included directly." +#endif + #ifndef __ATK_COMPONENT_H__ #define __ATK_COMPONENT_H__ #include #include -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ +G_BEGIN_DECLS /* * The AtkComponent interface should be supported by any object that is @@ -163,9 +165,7 @@ gboolean atk_component_set_size (AtkComponent *com gint width, gint height); gdouble atk_component_get_alpha (AtkComponent *component); -#ifdef __cplusplus -} -#endif /* __cplusplus */ +G_END_DECLS #endif /* __ATK_COMPONENT_H__ */ diff --git a/atk/atkdocument.h b/atk/atkdocument.h index 202cbef..275b5e8 100755 --- a/atk/atkdocument.h +++ b/atk/atkdocument.h @@ -17,15 +17,17 @@ * Boston, MA 02111-1307, USA. */ +#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (ATK_COMPILATION) +#error "Only can be included directly." +#endif + #ifndef __ATK_DOCUMENT_H__ #define __ATK_DOCUMENT_H__ #include #include -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ +G_BEGIN_DECLS /* * The AtkDocument interface should be supported by any object that is a container @@ -75,7 +77,7 @@ G_CONST_RETURN gchar* atk_document_get_attribute_value (AtkDocument *document, gboolean atk_document_set_attribute_value (AtkDocument *document, const gchar *attribute_name, const gchar *attribute_value); -#ifdef __cplusplus -} -#endif /* __cplusplus */ + +G_END_DECLS + #endif /* __ATK_DOCUMENT_H__ */ diff --git a/atk/atkeditabletext.h b/atk/atkeditabletext.h index 02937ff..da60bbd 100755 --- a/atk/atkeditabletext.h +++ b/atk/atkeditabletext.h @@ -17,15 +17,17 @@ * Boston, MA 02111-1307, USA. */ +#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (ATK_COMPILATION) +#error "Only can be included directly." +#endif + #ifndef __ATK_EDITABLE_TEXT_H__ #define __ATK_EDITABLE_TEXT_H__ #include #include -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ +G_BEGIN_DECLS /* * AtkEditableText is used to support access in an "accessibility" context @@ -96,10 +98,7 @@ void atk_editable_text_delete_text (AtkEditableText *text, gint end_pos); void atk_editable_text_paste_text (AtkEditableText *text, gint position); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ +G_END_DECLS #endif /* __ATK_EDITABLE_TEXT_H__ */ diff --git a/atk/atkgobjectaccessible.h b/atk/atkgobjectaccessible.h index adb46cd..13950ae 100644 --- a/atk/atkgobjectaccessible.h +++ b/atk/atkgobjectaccessible.h @@ -17,15 +17,16 @@ * Boston, MA 02111-1307, USA. */ +#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (ATK_COMPILATION) +#error "Only can be included directly." +#endif + #ifndef __ATK_GOBJECT_ACCESSIBLE_H__ #define __ATK_GOBJECT_ACCESSIBLE_H__ #include - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ +G_BEGIN_DECLS /* * The AtkGObjectAccessible class is provided as a basis for implementing @@ -59,9 +60,6 @@ struct _AtkGObjectAccessibleClass AtkObject *atk_gobject_accessible_for_object (GObject *obj); GObject *atk_gobject_accessible_get_object (AtkGObjectAccessible *obj); -#ifdef __cplusplus -} -#endif /* __cplusplus */ - +G_END_DECLS #endif /* __ATK_GOBJECT_ACCESSIBLE_H__ */ diff --git a/atk/atkhyperlink.h b/atk/atkhyperlink.h index a5d3716..01bab83 100755 --- a/atk/atkhyperlink.h +++ b/atk/atkhyperlink.h @@ -17,15 +17,17 @@ * Boston, MA 02111-1307, USA. */ +#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (ATK_COMPILATION) +#error "Only can be included directly." +#endif + #ifndef __ATK_HYPERLINK_H__ #define __ATK_HYPERLINK_H__ -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - #include +G_BEGIN_DECLS + /* * AtkHyperlink encapsulates a link or set of links in a hypertext document. * @@ -97,10 +99,6 @@ gboolean atk_hyperlink_is_inline (AtkHyperlink *link_); gint atk_hyperlink_get_n_anchors (AtkHyperlink *link_); gboolean atk_hyperlink_is_selected_link (AtkHyperlink *link_); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - +G_END_DECLS #endif /* __ATK_HYPERLINK_H__ */ diff --git a/atk/atkhyperlinkimpl.h b/atk/atkhyperlinkimpl.h index b08a1d5..d07a2fc 100644 --- a/atk/atkhyperlinkimpl.h +++ b/atk/atkhyperlinkimpl.h @@ -17,15 +17,17 @@ * Boston, MA 02111-1307, USA. */ +#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (ATK_COMPILATION) +#error "Only can be included directly." +#endif + #ifndef __ATK_HYPERLINK_IMPL_H__ #define __ATK_HYPERLINK_IMPL_H__ #include #include -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ +G_BEGIN_DECLS /* * The AtkHyperlinkImpl interface should be supported by objects @@ -68,9 +70,6 @@ GType atk_hyperlink_impl_get_type (void); AtkHyperlink *atk_hyperlink_impl_get_hyperlink (AtkHyperlinkImpl *obj); -#ifdef __cplusplus -} -#endif /* __cplusplus */ - +G_END_DECLS #endif /* __ATK_HYPERLINK_IMPL_H__ */ diff --git a/atk/atkhypertext.h b/atk/atkhypertext.h index 18464d9..d8328a8 100755 --- a/atk/atkhypertext.h +++ b/atk/atkhypertext.h @@ -17,15 +17,17 @@ * Boston, MA 02111-1307, USA. */ +#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (ATK_COMPILATION) +#error "Only can be included directly." +#endif + #ifndef __ATK_HYPERTEXT_H__ #define __ATK_HYPERTEXT_H__ #include #include -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ +G_BEGIN_DECLS /* * The AtkHypertext interface provides standard mechanisms for manipulating @@ -71,10 +73,6 @@ gint atk_hypertext_get_n_links (AtkHypertext *hypertext); gint atk_hypertext_get_link_index (AtkHypertext *hypertext, gint char_index); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - +G_END_DECLS #endif /* __ATK_HYPERTEXT_H__ */ diff --git a/atk/atkimage.h b/atk/atkimage.h index 7e60c81..dd45916 100755 --- a/atk/atkimage.h +++ b/atk/atkimage.h @@ -17,15 +17,17 @@ * Boston, MA 02111-1307, USA. */ +#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (ATK_COMPILATION) +#error "Only can be included directly." +#endif + #ifndef __ATK_IMAGE_H__ #define __ATK_IMAGE_H__ #include #include -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ +G_BEGIN_DECLS /* * The AtkImage interface should be supported by any object that has an @@ -80,7 +82,6 @@ void atk_image_get_image_position (AtkImage *image, G_CONST_RETURN gchar* atk_image_get_image_locale (AtkImage *image); -#ifdef __cplusplus -} -#endif /* __cplusplus */ +G_END_DECLS + #endif /* __ATK_IMAGE_H__ */ diff --git a/atk/atkmisc.h b/atk/atkmisc.h index d750e2d..dda4568 100755 --- a/atk/atkmisc.h +++ b/atk/atkmisc.h @@ -17,14 +17,16 @@ * Boston, MA 02111-1307, USA. */ +#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (ATK_COMPILATION) +#error "Only can be included directly." +#endif + #ifndef __ATK_MISC_H__ #define __ATK_MISC_H__ #include -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ +G_BEGIN_DECLS #define ATK_TYPE_MISC (atk_misc_get_type ()) #define ATK_IS_MISC(obj) G_TYPE_CHECK_INSTANCE_TYPE ((obj), ATK_TYPE_MISC) @@ -82,9 +84,6 @@ void atk_misc_threads_leave (AtkMisc *misc); */ const AtkMisc *atk_misc_get_instance (void); -#ifdef __cplusplus -} -#endif /* __cplusplus */ - +G_END_DECLS #endif /* __ATK_MISC_H__ */ diff --git a/atk/atknoopobject.h b/atk/atknoopobject.h index 3c4e432..261571c 100644 --- a/atk/atknoopobject.h +++ b/atk/atknoopobject.h @@ -17,6 +17,10 @@ * Boston, MA 02111-1307, USA. */ +#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (ATK_COMPILATION) +#error "Only can be included directly." +#endif + #ifndef __ATK_NO_OP_OBJECT_H__ #define __ATK_NO_OP_OBJECT_H__ diff --git a/atk/atknoopobjectfactory.h b/atk/atknoopobjectfactory.h index c324531..b216d6c 100755 --- a/atk/atknoopobjectfactory.h +++ b/atk/atknoopobjectfactory.h @@ -17,14 +17,16 @@ * Boston, MA 02111-1307, USA. */ +#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (ATK_COMPILATION) +#error "Only can be included directly." +#endif + #ifndef __ATK_NO_OP_OBJECT_FACTORY_H__ #define __ATK_NO_OP_OBJECT_FACTORY_H__ #include -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ +G_BEGIN_DECLS #define ATK_TYPE_NO_OP_OBJECT_FACTORY (atk_no_op_object_factory_get_type ()) #define ATK_NO_OP_OBJECT_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ATK_TYPE_NO_OP_OBJECT_FACTORY, AtkNoOpObjectFactory)) @@ -50,9 +52,6 @@ GType atk_no_op_object_factory_get_type(void); AtkObjectFactory *atk_no_op_object_factory_new(void); -#ifdef __cplusplus -} -#endif /* __cplusplus */ - +G_END_DECLS #endif /* __ATK_NO_OP_OBJECT_FACTORY_H__ */ diff --git a/atk/atkobject.h b/atk/atkobject.h index bb9b55a..39499e7 100755 --- a/atk/atkobject.h +++ b/atk/atkobject.h @@ -17,17 +17,19 @@ * Boston, MA 02111-1307, USA. */ +#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (ATK_COMPILATION) +#error "Only can be included directly." +#endif + #ifndef __ATK_OBJECT_H__ #define __ATK_OBJECT_H__ -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - #include #include #include +G_BEGIN_DECLS + /* * AtkObject represents the minimum information all accessible objects * return. This information includes accessible name, accessible @@ -640,9 +642,6 @@ G_CONST_RETURN gchar* atk_role_get_localized_name (AtkRole role * cpos = atk_text_get_caret_position (ATK_TEXT (accessible)); */ -#ifdef __cplusplus -} -#endif /* __cplusplus */ - +G_END_DECLS #endif /* __ATK_OBJECT_H__ */ diff --git a/atk/atkobjectfactory.h b/atk/atkobjectfactory.h index fb163ad..ff7e254 100755 --- a/atk/atkobjectfactory.h +++ b/atk/atkobjectfactory.h @@ -17,15 +17,17 @@ * Boston, MA 02111-1307, USA. */ +#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (ATK_COMPILATION) +#error "Only can be included directly." +#endif + #ifndef __ATK_OBJECT_FACTORY_H__ #define __ATK_OBJECT_FACTORY_H__ #include #include -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ +G_BEGIN_DECLS #define ATK_TYPE_OBJECT_FACTORY (atk_object_factory_get_type ()) #define ATK_OBJECT_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ATK_TYPE_OBJECT_FACTORY, AtkObjectFactory)) @@ -59,10 +61,7 @@ GType atk_object_factory_get_type(void); AtkObject* atk_object_factory_create_accessible (AtkObjectFactory *factory, GObject *obj); void atk_object_factory_invalidate (AtkObjectFactory *factory); GType atk_object_factory_get_accessible_type (AtkObjectFactory *factory); -#ifdef __cplusplus -} -#endif /* __cplusplus */ +G_END_DECLS #endif /* __GTK_OBJECT_FACTORY_H__ */ - diff --git a/atk/atkregistry.h b/atk/atkregistry.h index 3ab0414..eb16403 100644 --- a/atk/atkregistry.h +++ b/atk/atkregistry.h @@ -17,16 +17,18 @@ * Boston, MA 02111-1307, USA. */ +#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (ATK_COMPILATION) +#error "Only can be included directly." +#endif + #ifndef __ATK_REGISTRY_H__ #define __ATK_REGISTRY_H__ -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - #include #include "atkobjectfactory.h" +G_BEGIN_DECLS + #define ATK_TYPE_REGISTRY (atk_registry_get_type ()) #define ATK_REGISTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ATK_TYPE_REGISTRY, AtkRegistry)) #define ATK_REGISTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ATK_TYPE_REGISTRY, AtkRegistryClass)) @@ -61,9 +63,7 @@ AtkObjectFactory* atk_registry_get_factory (AtkRegistry *registry, AtkRegistry* atk_get_default_registry (void); -#ifdef __cplusplus -} -#endif /* __cplusplus */ +G_END_DECLS #endif /* __ATK_REGISTRY_H__ */ diff --git a/atk/atkrelation.h b/atk/atkrelation.h index 08b0708..88db375 100755 --- a/atk/atkrelation.h +++ b/atk/atkrelation.h @@ -17,12 +17,14 @@ * Boston, MA 02111-1307, USA. */ +#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (ATK_COMPILATION) +#error "Only can be included directly." +#endif + #ifndef __ATK_RELATION_H__ #define __ATK_RELATION_H__ -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ +G_BEGIN_DECLS #include #include @@ -79,10 +81,7 @@ AtkRelationType atk_relation_get_relation_type (AtkRelation *relation GPtrArray* atk_relation_get_target (AtkRelation *relation); void atk_relation_add_target (AtkRelation *relation, AtkObject *target); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ +G_END_DECLS #endif /* __ATK_RELATION_H__ */ diff --git a/atk/atkrelationset.h b/atk/atkrelationset.h index 2225baf..9bf572c 100755 --- a/atk/atkrelationset.h +++ b/atk/atkrelationset.h @@ -17,12 +17,14 @@ * Boston, MA 02111-1307, USA. */ +#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (ATK_COMPILATION) +#error "Only can be included directly." +#endif + #ifndef __ATK_RELATION_SET_H__ #define __ATK_RELATION_SET_H__ -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ +G_BEGIN_DECLS #include #include @@ -71,9 +73,6 @@ void atk_relation_set_add_relation_by_type (AtkRelationSet *set, AtkRelationType relationship, AtkObject *target); -#ifdef __cplusplus -} -#endif /* __cplusplus */ - +G_END_DECLS #endif /* __ATK_RELATION_SET_H__ */ diff --git a/atk/atkrelationtype.h b/atk/atkrelationtype.h index 665c675..ad34bfc 100755 --- a/atk/atkrelationtype.h +++ b/atk/atkrelationtype.h @@ -17,12 +17,16 @@ * Boston, MA 02111-1307, USA. */ +#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (ATK_COMPILATION) +#error "Only can be included directly." +#endif + #ifndef __ATK_RELATION_TYPE_H__ #define __ATK_RELATION_TYPE_H__ -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ +#include + +G_BEGIN_DECLS /** *AtkRelationType: @@ -72,8 +76,6 @@ typedef enum ATK_RELATION_LAST_DEFINED } AtkRelationType; -#ifdef __cplusplus -} -#endif /* __cplusplus */ +G_END_DECLS #endif /* __ATK_RELATION_TYPE_H__ */ diff --git a/atk/atkselection.h b/atk/atkselection.h index 7b16930..9a0050f 100755 --- a/atk/atkselection.h +++ b/atk/atkselection.h @@ -17,14 +17,16 @@ * Boston, MA 02111-1307, USA. */ +#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (ATK_COMPILATION) +#error "Only can be included directly." +#endif + #ifndef __ATK_SELECTION_H__ #define __ATK_SELECTION_H__ #include -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ +G_BEGIN_DECLS /* * This AtkSelection interface provides the standard mechanism for an @@ -88,9 +90,6 @@ gboolean atk_selection_remove_selection (AtkSelection *selection, gboolean atk_selection_select_all_selection (AtkSelection *selection); -#ifdef __cplusplus -} -#endif /* __cplusplus */ - +G_END_DECLS #endif /* __ATK_SELECTION_H__ */ diff --git a/atk/atkstate.h b/atk/atkstate.h index 3317346..0beba72 100755 --- a/atk/atkstate.h +++ b/atk/atkstate.h @@ -17,15 +17,17 @@ * Boston, MA 02111-1307, USA. */ +#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (ATK_COMPILATION) +#error "Only can be included directly." +#endif + #ifndef __ATK_STATE_H__ #define __ATK_STATE_H__ -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - #include +G_BEGIN_DECLS + /** *AtkStateType: *@ATK_STATE_INVALID: Indicates an invalid state - probably an error condition. @@ -171,8 +173,6 @@ AtkStateType atk_state_type_register (const gchar *name); G_CONST_RETURN gchar* atk_state_type_get_name (AtkStateType type); AtkStateType atk_state_type_for_name (const gchar *name); -#ifdef __cplusplus -} -#endif /* __cplusplus */ +G_END_DECLS #endif /* __ATK_STATE_H__ */ diff --git a/atk/atkstateset.h b/atk/atkstateset.h index 43c3ea3..b592eb5 100755 --- a/atk/atkstateset.h +++ b/atk/atkstateset.h @@ -17,17 +17,19 @@ * Boston, MA 02111-1307, USA. */ +#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (ATK_COMPILATION) +#error "Only can be included directly." +#endif + #ifndef __ATK_STATE_SET_H__ #define __ATK_STATE_SET_H__ -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - #include #include #include +G_BEGIN_DECLS + #define ATK_TYPE_STATE_SET (atk_state_set_get_type ()) #define ATK_STATE_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ATK_TYPE_STATE_SET, AtkStateSet)) #define ATK_STATE_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ATK_TYPE_STATE_SET, AtkStateSetClass)) @@ -73,9 +75,6 @@ AtkStateSet* atk_state_set_or_sets (AtkStateSet *set, AtkStateSet* atk_state_set_xor_sets (AtkStateSet *set, AtkStateSet *compare_set); -#ifdef __cplusplus -} -#endif /* __cplusplus */ - +G_END_DECLS #endif /* __ATK_STATE_SET_H__ */ diff --git a/atk/atkstreamablecontent.h b/atk/atkstreamablecontent.h index abdbfa9..b3bd98d 100755 --- a/atk/atkstreamablecontent.h +++ b/atk/atkstreamablecontent.h @@ -17,14 +17,16 @@ * Boston, MA 02111-1307, USA. */ +#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (ATK_COMPILATION) +#error "Only can be included directly." +#endif + #ifndef __ATK_STREAMABLE_CONTENT_H__ #define __ATK_STREAMABLE_CONTENT_H__ #include -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ +G_BEGIN_DECLS #define ATK_TYPE_STREAMABLE_CONTENT (atk_streamable_content_get_type ()) #define ATK_IS_STREAMABLE_CONTENT(obj) G_TYPE_CHECK_INSTANCE_TYPE ((obj), ATK_TYPE_STREAMABLE_CONTENT) @@ -98,10 +100,6 @@ GIOChannel* atk_streamable_content_get_stream (AtkStreamableCo gchar* atk_streamable_content_get_uri (AtkStreamableContent *streamable, const gchar *mime_type); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - +G_END_DECLS #endif /* __ATK_STREAMABLE_CONTENT_H__ */ diff --git a/atk/atktable.h b/atk/atktable.h index 790fbb4..909b508 100755 --- a/atk/atktable.h +++ b/atk/atktable.h @@ -17,14 +17,16 @@ * Boston, MA 02111-1307, USA. */ +#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (ATK_COMPILATION) +#error "Only can be included directly." +#endif + #ifndef __ATK_TABLE_H__ #define __ATK_TABLE_H__ #include -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ +G_BEGIN_DECLS /* * AtkTable describes a user-interface component that presents data in @@ -210,9 +212,6 @@ gboolean atk_table_remove_column_selection (AtkTable *table, gint column); -#ifdef __cplusplus -} -#endif /* __cplusplus */ - +G_END_DECLS #endif /* __ATK_TABLE_H__ */ diff --git a/atk/atktext.h b/atk/atktext.h index 191e231..7ff3521 100755 --- a/atk/atktext.h +++ b/atk/atktext.h @@ -17,6 +17,9 @@ * Boston, MA 02111-1307, USA. */ +#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (ATK_COMPILATION) +#error "Only can be included directly." +#endif #ifndef __ATK_TEXT_H__ #define __ATK_TEXT_H__ @@ -25,9 +28,7 @@ #include #include -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ +G_BEGIN_DECLS /** *AtkTextAttribute @@ -359,9 +360,6 @@ AtkTextAttribute atk_text_attribute_for_name (const gchar *nam G_CONST_RETURN gchar* atk_text_attribute_get_value (AtkTextAttribute attr, gint index_); -#ifdef __cplusplus -} -#endif /* __cplusplus */ - +G_END_DECLS #endif /* __ATK_TEXT_H__ */ diff --git a/atk/atkutil.h b/atk/atkutil.h index e96eb64..9b73599 100755 --- a/atk/atkutil.h +++ b/atk/atkutil.h @@ -17,14 +17,16 @@ * Boston, MA 02111-1307, USA. */ +#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (ATK_COMPILATION) +#error "Only can be included directly." +#endif + #ifndef __ATK_UTIL_H__ #define __ATK_UTIL_H__ #include -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ +G_BEGIN_DECLS #define ATK_TYPE_UTIL (atk_util_get_type ()) #define ATK_IS_UTIL(obj) G_TYPE_CHECK_INSTANCE_TYPE ((obj), ATK_TYPE_UTIL) @@ -306,10 +308,6 @@ type_name##_get_type (void) \ return g_define_type_id__volatile; \ } /* closes type_name##_get_type() */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - +G_END_DECLS #endif /* __ATK_UTIL_H__ */ diff --git a/atk/atkvalue.h b/atk/atkvalue.h index f66c015..276b679 100755 --- a/atk/atkvalue.h +++ b/atk/atkvalue.h @@ -17,14 +17,16 @@ * Boston, MA 02111-1307, USA. */ +#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (ATK_COMPILATION) +#error "Only can be included directly." +#endif + #ifndef __ATK_VALUE_H__ #define __ATK_VALUE_H__ #include -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ +G_BEGIN_DECLS /* * The AtkValue interface should be supported by any object that @@ -86,10 +88,6 @@ void atk_value_get_minimum_increment (AtkValue *obj, * (the accessible value has changed) */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - +G_END_DECLS #endif /* __ATK_VALUE_H__ */ diff --git a/configure.in b/configure.in index c80256b..058e928 100644 --- a/configure.in +++ b/configure.in @@ -132,6 +132,8 @@ AC_ARG_ENABLE(rebuilds, [disable all source autogeneration rules])],, [enable_rebuilds=yes]) +CPPFLAGS="$CPPFLAGS -DG_DISABLE_SINGLE_INCLUDES -DATK_DISABLE_SINGLE_INCLUDES" + changequote(,)dnl if test "x$GCC" = "xyes"; then case " $CFLAGS " in -- 2.7.4