mirror of
				https://gitlab.freedesktop.org/wlroots/wlroots.git
				synced 2025-11-03 09:01:40 -05:00 
			
		
		
		
	fix: handle 32 bit time_t (or smaller)
This commit is contained in:
		
							parent
							
								
									ffc8780893
								
							
						
					
					
						commit
						fad62a3e1c
					
				
					 2 changed files with 6 additions and 4 deletions
				
			
		| 
						 | 
				
			
			@ -46,8 +46,9 @@ static void frame_output_handle_swap_buffers(struct wl_listener *listener,
 | 
			
		|||
	wl_list_remove(&frame->output_swap_buffers.link);
 | 
			
		||||
	wl_list_init(&frame->output_swap_buffers.link);
 | 
			
		||||
 | 
			
		||||
	uint32_t tv_sec_hi = event->when->tv_sec >> 32;
 | 
			
		||||
	uint32_t tv_sec_lo = event->when->tv_sec & 0xFFFFFFFF;
 | 
			
		||||
	time_t tv_sec = event->when->tv_sec;
 | 
			
		||||
	uint32_t tv_sec_hi = (sizeof(tv_sec) > 4) ? tv_sec >> 32 : 0;
 | 
			
		||||
	uint32_t tv_sec_lo = tv_sec & 0xFFFFFFFF;
 | 
			
		||||
	zwlr_export_dmabuf_frame_v1_send_ready(frame->resource,
 | 
			
		||||
		tv_sec_hi, tv_sec_lo, event->when->tv_nsec);
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -66,8 +66,9 @@ static void frame_handle_output_swap_buffers(struct wl_listener *listener,
 | 
			
		|||
 | 
			
		||||
	zwlr_screencopy_frame_v1_send_flags(frame->resource, flags);
 | 
			
		||||
 | 
			
		||||
	uint32_t tv_sec_hi = event->when->tv_sec >> 32;
 | 
			
		||||
	uint32_t tv_sec_lo = event->when->tv_sec & 0xFFFFFFFF;
 | 
			
		||||
	time_t tv_sec = event->when->tv_sec;
 | 
			
		||||
	uint32_t tv_sec_hi = (sizeof(tv_sec) > 4) ? tv_sec >> 32 : 0;
 | 
			
		||||
	uint32_t tv_sec_lo = tv_sec & 0xFFFFFFFF;
 | 
			
		||||
	zwlr_screencopy_frame_v1_send_ready(frame->resource,
 | 
			
		||||
		tv_sec_hi, tv_sec_lo, event->when->tv_nsec);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue