From: Tor Lillqvist Date: Fri, 9 Mar 2001 21:39:51 +0000 (+0000) Subject: Use G_BEGIN_DECLS and G_END_DECLS. X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=137d3248c7ecbd8a012c623c9c5c7cd93ace6808;p=dana%2Fcg-glib.git Use G_BEGIN_DECLS and G_END_DECLS. 2001-02-21 Tor Lillqvist * *.h: Use G_BEGIN_DECLS and G_END_DECLS. * Makefile.am: Use libglib-1.3.la from top_builddir. Invoke libtool with -no-undefined for Win32 and Cygwin. --- diff --git a/glib/gbsearcharray.h b/glib/gbsearcharray.h index 1bc0ab21..dc23ffd2 100644 --- a/glib/gbsearcharray.h +++ b/glib/gbsearcharray.h @@ -23,11 +23,7 @@ #include - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - +G_BEGIN_DECLS /* helper macro to avoid signed overflow for value comparisions */ #define G_BSEARCH_ARRAY_CMP(v1,v2) ((v1) < (v2) ? -1 : (v1) > (v2) ? 1 : 0) @@ -138,11 +134,6 @@ g_bsearch_array_get_index (GBSearchArray *barray, } #endif /* G_CAN_INLINE || __G_BSEARCHARRAY_C__ */ - - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ +G_END_DECLS #endif /* __G_BSEARCH_ARRAY_H__ */ diff --git a/gobject/ChangeLog b/gobject/ChangeLog index 002a2956..ada4431a 100644 --- a/gobject/ChangeLog +++ b/gobject/ChangeLog @@ -156,6 +156,13 @@ Tue Feb 27 18:35:15 2001 Tim Janik * gvalue.[hc]: marked g_value_fits_pointer() and g_value_peek_pointer() as private (the latter got renamed from g_value_get_as_pointer()). +2001-02-21 Tor Lillqvist + + * *.h: Use G_BEGIN_DECLS and G_END_DECLS. + + * Makefile.am: Use libglib-1.3.la from top_builddir. Invoke + libtool with -no-undefined for Win32 and Cygwin. + Wed Feb 21 18:31:46 2001 Jonathan Blandford * gsignal.h (g_signal_connect): Add g_signal_connect define to diff --git a/gobject/Makefile.am b/gobject/Makefile.am index fdf03bf1..61cabe7f 100644 --- a/gobject/Makefile.am +++ b/gobject/Makefile.am @@ -11,16 +11,25 @@ INCLUDES = @STRIP_BEGIN@ \ -DG_DISABLE_CONST_RETURNS \ @STRIP_END@ +libglib = $(top_builddir)/libglib-1.3.la + # libraries to compile and install lib_LTLIBRARIES = libgobject-1.3.la +if PLATFORM_WIN32 +no_undefined = -no-undefined +endif +if OS_WIN32 +export_symbols = -export-symbols gobject.def +endif + # libtool stuff: set version and export symbols for resolving libgobjectincludedir = $(includedir)/glib-2.0/gobject libgobject_1_3_la_LDFLAGS = @STRIP_BEGIN@ \ -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \ - -export-dynamic \ + -export-dynamic $(no_undefined) $(export_symbols) \ @STRIP_END@ -libgobject_1_3_la_LIBADD = # $(libglib) +libgobject_1_3_la_LIBADD = $(libglib) # # setup source file variables @@ -116,7 +125,7 @@ gmarshal.h: # never add deps here # versions in the build dir. thus a development setup requires # srcdir to be writable, passing --disable-rebuilds to # ../configure will supress all autogeneration rules. -$(srcdir)/stamp-gmarshal.h: @REBUILD@ gmarshal.list gmarshal.h glib-genmarshal +$(srcdir)/stamp-gmarshal.h: @REBUILD@ gmarshal.list gmarshal.h glib-genmarshal$(EXEEXT) echo "#ifndef __G_MARSHAL_H__" > xgen-gmh \ && echo "#define __G_MARSHAL_H__" >> xgen-gmh \ && ./glib-genmarshal --nostdinc --prefix=g_cclosure_marshal $(srcdir)/gmarshal.list --header >> xgen-gmh \ @@ -149,8 +158,8 @@ gobject_query_SOURCES = gobject-query.c glib_genmarshal_SOURCES = glib-genmarshal.c testgruntime_SOURCES = testgruntime.c # link programs against libgobject -progs_LDADD = libgobject-1.3.la ../libglib-1.3.la -glib_genmarshal_LDADD = ../libglib-1.3.la # can't have libgobject here +progs_LDADD = libgobject-1.3.la $(libglib) +glib_genmarshal_LDADD = $(libglib) gobject_query_LDADD = $(progs_LDADD) testgruntime_LDADD = $(progs_LDADD) diff --git a/gobject/gboxed.h b/gobject/gboxed.h index c12bd403..e4e8f5e8 100644 --- a/gobject/gboxed.h +++ b/gobject/gboxed.h @@ -21,11 +21,7 @@ #include - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - +G_BEGIN_DECLS /* --- type macros --- */ #define G_TYPE_IS_BOXED(type) (G_TYPE_FUNDAMENTAL (type) == G_TYPE_BOXED) @@ -66,8 +62,6 @@ void g_value_set_boxed_take_ownership (GValue *value, -#ifdef __cplusplus -} -#endif /* __cplusplus */ +G_END_DECLS #endif /* __G_BOXED_H__ */ diff --git a/gobject/gbsearcharray.h b/gobject/gbsearcharray.h index 1bc0ab21..dc23ffd2 100644 --- a/gobject/gbsearcharray.h +++ b/gobject/gbsearcharray.h @@ -23,11 +23,7 @@ #include - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - +G_BEGIN_DECLS /* helper macro to avoid signed overflow for value comparisions */ #define G_BSEARCH_ARRAY_CMP(v1,v2) ((v1) < (v2) ? -1 : (v1) > (v2) ? 1 : 0) @@ -138,11 +134,6 @@ g_bsearch_array_get_index (GBSearchArray *barray, } #endif /* G_CAN_INLINE || __G_BSEARCHARRAY_C__ */ - - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ +G_END_DECLS #endif /* __G_BSEARCH_ARRAY_H__ */ diff --git a/gobject/gclosure.h b/gobject/gclosure.h index 8ae329f6..0057a818 100644 --- a/gobject/gclosure.h +++ b/gobject/gclosure.h @@ -22,12 +22,7 @@ #include - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - - +G_BEGIN_DECLS /* --- defines --- */ #define G_CLOSURE_NEEDS_MARSHAL(closure) (((GClosure*) (closure))->marshal == NULL) @@ -158,9 +153,6 @@ void g_closure_invoke (GClosure *closure, - provide marshaller collection, virtually covering anything out there */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ +G_END_DECLS #endif /* __G_CLOSURE_H__ */ diff --git a/gobject/genums.h b/gobject/genums.h index bd1ea6ef..699d4bd5 100644 --- a/gobject/genums.h +++ b/gobject/genums.h @@ -21,11 +21,7 @@ #include - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - +G_BEGIN_DECLS /* --- type macros --- */ #define G_TYPE_IS_ENUM(type) (G_TYPE_FUNDAMENTAL (type) == G_TYPE_ENUM) @@ -118,10 +114,6 @@ void g_flags_complete_type_info (GType g_flags_type, GTypeInfo *info, const GFlagsValue *const_values); - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ +G_END_DECLS #endif /* __G_ENUMS_H__ */ diff --git a/gobject/gobject.h b/gobject/gobject.h index 31eb5643..6ebff628 100644 --- a/gobject/gobject.h +++ b/gobject/gobject.h @@ -24,11 +24,7 @@ #include #include - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - +G_BEGIN_DECLS /* --- type macros --- */ #define G_TYPE_IS_OBJECT(type) (G_TYPE_FUNDAMENTAL (type) == G_TYPE_OBJECT) @@ -206,10 +202,6 @@ G_STMT_START { \ G_OBJECT_TYPE_NAME (_object)); \ } G_STMT_END - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ +G_END_DECLS #endif /* __G_OBJECT_H__ */ diff --git a/gobject/gparam.h b/gobject/gparam.h index d186ffdf..a393613d 100644 --- a/gobject/gparam.h +++ b/gobject/gparam.h @@ -24,11 +24,7 @@ #include - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - +G_BEGIN_DECLS /* --- type macros --- */ #define G_TYPE_IS_PARAM(type) (G_TYPE_FUNDAMENTAL (type) == G_TYPE_PARAM) @@ -187,8 +183,6 @@ GParamSpec* g_param_spec_pool_lookup (GParamSpecPool *pool, * >0 if value1 > value2, and 0 otherwise (they are equal) */ -#ifdef __cplusplus -} -#endif /* __cplusplus */ +G_END_DECLS #endif /* __G_PARAM_H__ */ diff --git a/gobject/gparamspecs.h b/gobject/gparamspecs.h index ecfbf27c..c4fffd3f 100644 --- a/gobject/gparamspecs.h +++ b/gobject/gparamspecs.h @@ -27,11 +27,7 @@ #include #include - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - +G_BEGIN_DECLS /* --- type macros --- */ #define G_IS_PARAM_SPEC_CHAR(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_CHAR)) @@ -330,8 +326,6 @@ GParamSpec* g_param_spec_object (const gchar *name, GParamFlags flags); -#ifdef __cplusplus -} -#endif /* __cplusplus */ +G_END_DECLS #endif /* __G_PARAMSPECS_H__ */ diff --git a/gobject/gsignal.h b/gobject/gsignal.h index 476178e7..67b1fb43 100644 --- a/gobject/gsignal.h +++ b/gobject/gsignal.h @@ -25,11 +25,7 @@ #include #include - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - +G_BEGIN_DECLS /* --- typedefs --- */ typedef struct _GSignalQuery GSignalQuery; @@ -227,9 +223,6 @@ guint g_signal_handlers_disconnect_matched (gpointer instance, void g_signal_handlers_destroy (gpointer instance); void _g_signals_destroy (GType itype); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ +G_END_DECLS #endif /* __G_SIGNAL_H__ */ diff --git a/gobject/gtype.h b/gobject/gtype.h index e60f0a33..9031e27d 100644 --- a/gobject/gtype.h +++ b/gobject/gtype.h @@ -22,11 +22,7 @@ extern const char *g_log_domain_gruntime; #include - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - +G_BEGIN_DECLS /* Basic Type Macros */ @@ -361,9 +357,6 @@ GTypeValueTable* g_type_value_table_peek (GType type); #define G_TYPE_FLAG_RESERVED_ID_BIT (1 << 30) extern GTypeDebugFlags _g_type_debug_flags; - -#ifdef __cplusplus -} -#endif /* __cplusplus */ +G_END_DECLS #endif /* __G_TYPE_H__ */ diff --git a/gobject/gtypeplugin.h b/gobject/gtypeplugin.h index 380dd32f..df692589 100644 --- a/gobject/gtypeplugin.h +++ b/gobject/gtypeplugin.h @@ -22,12 +22,7 @@ #include - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - - +G_BEGIN_DECLS /* --- type macros --- */ #define G_TYPE_TYPE_PLUGIN (g_type_plugin_get_type ()) @@ -74,12 +69,6 @@ void g_type_plugin_complete_interface_info (GTypePlugin *plugin, GType instance_type, GInterfaceInfo *info); - - - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ +G_END_DECLS #endif /* __G_TYPE_PLUGIN_H__ */ diff --git a/gobject/gvalue.h b/gobject/gvalue.h index 7b68b48c..6217738d 100644 --- a/gobject/gvalue.h +++ b/gobject/gvalue.h @@ -24,10 +24,7 @@ #include -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - +G_BEGIN_DECLS /* --- type macros --- */ #define G_TYPE_IS_VALUE(type) (g_type_value_table_peek (type) != NULL) @@ -89,8 +86,6 @@ void g_value_register_transform_func (GType src_type, #define G_VALUE_NOCOPY_CONTENTS (1 << 27) -#ifdef __cplusplus -} -#endif /* __cplusplus */ +G_END_DECLS #endif /* __G_VALUE_H__ */ diff --git a/gobject/gvaluecollector.h b/gobject/gvaluecollector.h index 55b613d8..04522de8 100644 --- a/gobject/gvaluecollector.h +++ b/gobject/gvaluecollector.h @@ -21,11 +21,7 @@ #ifndef __G_VALUE_COLLECTOR_H__ #define __G_VALUE_COLLECTOR_H__ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - +G_BEGIN_DECLS /* we may want to add aggregate types here some day, if requested * by users. the basic C types are covered already, everything @@ -149,10 +145,6 @@ G_STMT_START { \ #define G_VALUE_COLLECT_FORMAT_MAX_LENGTH (8) - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ +G_END_DECLS #endif /* __G_VALUE_COLLECTOR_H__ */ diff --git a/gobject/gvaluetypes.h b/gobject/gvaluetypes.h index 557ca234..5b1910cb 100644 --- a/gobject/gvaluetypes.h +++ b/gobject/gvaluetypes.h @@ -24,11 +24,7 @@ #include - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - +G_BEGIN_DECLS /* --- type macros --- */ #define G_VALUE_HOLDS_CHAR(value) (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_CHAR)) @@ -89,8 +85,6 @@ void g_value_set_string_take_ownership (GValue *value, -#ifdef __cplusplus -} -#endif /* __cplusplus */ +G_END_DECLS #endif /* __G_VALUETYPES_H__ */