mirror of
				https://gitlab.gnome.org/GNOME/glib.git
				synced 2025-10-31 16:32:18 +01:00 
			
		
		
		
	Add macros for GSourceFunc return values
The boolean values to be returned by a GSourceFunc are always ambiguous, and even in case of experienced developers then can lead to confusion. The Perl bindings for GLib have two simple constants, mapping to TRUE and FALSE, that make the return values less confusing: G_SOURCE_CONTINUE and G_SOURCE_REMOVE respectively. https://bugzilla.gnome.org/show_bug.cgi?id=631413
This commit is contained in:
		
				
					committed by
					
						 Ryan Lortie
						Ryan Lortie
					
				
			
			
				
	
			
			
			
						parent
						
							e5653c0050
						
					
				
				
					commit
					e15d5313af
				
			| @@ -446,6 +446,10 @@ G_PRIORITY_HIGH_IDLE | ||||
| G_PRIORITY_DEFAULT_IDLE | ||||
| G_PRIORITY_LOW | ||||
|  | ||||
| <SUBSECTION> | ||||
| G_SOURCE_CONTINUE | ||||
| G_SOURCE_REMOVE | ||||
|  | ||||
| <SUBSECTION> | ||||
| GMainContext | ||||
| g_main_context_new | ||||
|   | ||||
							
								
								
									
										20
									
								
								glib/gmain.h
									
									
									
									
									
								
							
							
						
						
									
										20
									
								
								glib/gmain.h
									
									
									
									
									
								
							| @@ -258,6 +258,26 @@ struct _GSourceFuncs | ||||
|  */ | ||||
| #define G_PRIORITY_LOW              300 | ||||
|  | ||||
| /** | ||||
|  * G_SOURCE_REMOVE: | ||||
|  * | ||||
|  * Use this macro as the return value of a #GSourceFunc to remove | ||||
|  * the #GSource from the main loop. | ||||
|  * | ||||
|  * Since: 2.28 | ||||
|  */ | ||||
| #define G_SOURCE_REMOVE         FALSE | ||||
|  | ||||
| /** | ||||
|  * G_SOURCE_CONTINUE: | ||||
|  * | ||||
|  * Use this macro as the return value of a #GSourceFunc to leave | ||||
|  * the #GSource in the main loop. | ||||
|  * | ||||
|  * Since: 2.28 | ||||
|  */ | ||||
| #define G_SOURCE_CONTINUE       TRUE | ||||
|  | ||||
| /* GMainContext: */ | ||||
|  | ||||
| GMainContext *g_main_context_new       (void); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user