[geany/geany] b70dbc: Use our own deprecation macros

Colomban Wendling git-noreply at xxxxx
Tue Mar 1 18:21:41 UTC 2016


Branch:      refs/heads/master
Author:      Colomban Wendling <ban at herbesfolles.org>
Committer:   Colomban Wendling <ban at herbesfolles.org>
Date:        Tue, 01 Mar 2016 18:21:41 UTC
Commit:      b70dbc44bd2973f9a08996d3fb0aee8e1ede33f7
             https://github.com/geany/geany/commit/b70dbc44bd2973f9a08996d3fb0aee8e1ede33f7

Log Message:
-----------
Use our own deprecation macros

This allows us to conditionally enable our deprecation warnings, like
when building Geany itself or when `GEANY_DISABLE_DEPRECATION_WARNINGS`
is defined.


Modified Paths:
--------------
    doc/Doxyfile.in
    src/geany.h
    src/plugindata.h
    src/sciwrappers.h
    src/ui_utils.h

Modified: doc/Doxyfile.in
4 lines changed, 2 insertions(+), 2 deletions(-)
===================================================================
@@ -2020,8 +2020,8 @@ INCLUDE_FILE_PATTERNS  =
 # This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
 
 PREDEFINED             = "G_GNUC_PRINTF(x,y)=" \
-                         G_GNUC_DEPRECATED= \
-                         G_GNUC_DEPRECATED_FOR(x)= \
+                         GEANY_DEPRECATED= \
+                         GEANY_DEPRECATED_FOR(x)= \
                          HAVE_PLUGINS \
                          GEANY_FUNCTIONS_H
 


Modified: src/geany.h
8 lines changed, 8 insertions(+), 0 deletions(-)
===================================================================
@@ -55,6 +55,14 @@ G_BEGIN_DECLS
 #define G_GNUC_WARN_UNUSED_RESULT
 #endif
 
+#if defined(GEANY_PRIVATE) || defined(GEANY_DISABLE_DEPRECATION_WARNINGS)
+#	define GEANY_DEPRECATED
+#	define GEANY_DEPRECATED_FOR(x)
+#else
+#	define GEANY_DEPRECATED			G_GNUC_DEPRECATED
+#	define GEANY_DEPRECATED_FOR(x)	G_GNUC_DEPRECATED_FOR(x)
+#endif
+
 /* Re-defined by plugindata.h as something else */
 #ifndef GEANY
 # define GEANY(symbol_name) symbol_name


Modified: src/plugindata.h
7 lines changed, 4 insertions(+), 3 deletions(-)
===================================================================
@@ -32,6 +32,7 @@
 #ifndef GEANY_PLUGIN_DATA_H
 #define GEANY_PLUGIN_DATA_H 1
 
+#include "geany.h"  /* for GEANY_DEPRECATED */
 #include "build.h"  /* GeanyBuildGroup, GeanyBuildSource, GeanyBuildCmdEntries enums */
 #include "document.h" /* GeanyDocument */
 #include "editor.h"	/* GeanyEditor, GeanyIndentType */
@@ -354,7 +355,7 @@ gint geany_plugin_register_proxy(GeanyPlugin *plugin, const gchar **extensions);
 /* This remains so that older plugins that contain a `GeanyFunctions *geany_functions;`
  * variable in their plugin - as was previously required - will still compile
  * without changes.  */
-typedef struct GeanyFunctionsUndefined GeanyFunctions G_GNUC_DEPRECATED;
+typedef struct GeanyFunctionsUndefined GeanyFunctions GEANY_DEPRECATED;
 
 /** @deprecated - use plugin_set_key_group() instead.
  * @see PLUGIN_KEY_GROUP() macro. */
@@ -363,7 +364,7 @@ typedef struct GeanyKeyGroupInfo
 	const gchar *name;		/**< Group name used in the configuration file, such as @c "html_chars" */
 	gsize count;			/**< The number of keybindings the group will hold */
 }
-GeanyKeyGroupInfo G_GNUC_DEPRECATED_FOR(plugin_set_key_group);
+GeanyKeyGroupInfo GEANY_DEPRECATED_FOR(plugin_set_key_group);
 
 /** @deprecated - use plugin_set_key_group() instead.
  * Declare and initialise a keybinding group.
@@ -404,7 +405,7 @@ typedef struct PluginFields
 	 *  This is required if using @c PLUGIN_IS_DOCUMENT_SENSITIVE, ignored otherwise */
 	GtkWidget	*menu_item;
 }
-PluginFields G_GNUC_DEPRECATED_FOR(ui_add_document_sensitive);
+PluginFields GEANY_DEPRECATED_FOR(ui_add_document_sensitive);
 
 #define document_reload_file document_reload_force
 


Modified: src/sciwrappers.h
7 lines changed, 4 insertions(+), 3 deletions(-)
===================================================================
@@ -22,6 +22,7 @@
 #ifndef GEANY_SCI_WRAPPERS_H
 #define GEANY_SCI_WRAPPERS_H 1
 
+#include "geany.h" /* for GEANY_DEPRECATED */
 #include "gtkcompat.h" /* Needed by ScintillaWidget.h */
 #include "Scintilla.h" /* Needed by ScintillaWidget.h */
 #include "ScintillaWidget.h" /* for ScintillaObject */
@@ -93,9 +94,9 @@ gint				sci_get_line_indentation	(ScintillaObject *sci, gint line);
 gint				sci_find_matching_brace		(ScintillaObject *sci, gint pos);
 
 #ifndef GEANY_DISABLE_DEPRECATED
-void				sci_get_text				(ScintillaObject *sci, gint len, gchar *text) G_GNUC_DEPRECATED_FOR(sci_get_contents);
-void				sci_get_selected_text		(ScintillaObject *sci, gchar *text) G_GNUC_DEPRECATED_FOR(sci_get_selection_contents);
-void				sci_get_text_range			(ScintillaObject *sci, gint start, gint end, gchar *text) G_GNUC_DEPRECATED_FOR(sci_get_contents_range);
+void				sci_get_text				(ScintillaObject *sci, gint len, gchar *text) GEANY_DEPRECATED_FOR(sci_get_contents);
+void				sci_get_selected_text		(ScintillaObject *sci, gchar *text) GEANY_DEPRECATED_FOR(sci_get_selection_contents);
+void				sci_get_text_range			(ScintillaObject *sci, gint start, gint end, gchar *text) GEANY_DEPRECATED_FOR(sci_get_contents_range);
 #endif	/* GEANY_DISABLE_DEPRECATED */
 
 #ifdef GEANY_PRIVATE


Modified: src/ui_utils.h
3 lines changed, 2 insertions(+), 1 deletions(-)
===================================================================
@@ -22,6 +22,7 @@
 #ifndef GEANY_UI_UTILS_H
 #define GEANY_UI_UTILS_H 1
 
+#include "geany.h" /* for GEANY_DEPRECATED */
 #include "document.h"
 
 #include "gtkcompat.h"
@@ -142,7 +143,7 @@ void ui_tree_view_set_tooltip_text_column(GtkTreeView *tree_view, gint column);
 
 
 #ifndef GEANY_DISABLE_DEPRECATED
-void ui_widget_set_tooltip_text(GtkWidget *widget, const gchar *text) G_GNUC_DEPRECATED_FOR(gtk_widget_set_tooltip_text);
+void ui_widget_set_tooltip_text(GtkWidget *widget, const gchar *text) GEANY_DEPRECATED_FOR(gtk_widget_set_tooltip_text);
 #endif	/* GEANY_DISABLE_DEPRECATED */
 
 



--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).


More information about the Commits mailing list