Cater for use of __errno_r() in ChibiOS syscalls.c with newer picolibc revisions (#25121)
				
					
				
			This commit is contained in:
		
							parent
							
								
									dc26e99dd5
								
							
						
					
					
						commit
						6b8670fe8f
					
				
					 1 changed files with 13 additions and 0 deletions
				
			
		
							
								
								
									
										13
									
								
								platforms/chibios/errno.h
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								platforms/chibios/errno.h
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,13 @@
 | 
			
		|||
// Copyright 2025 Nick Brassel (@tzarc)
 | 
			
		||||
// SPDX-License-Identifier: GPL-2.0-or-later
 | 
			
		||||
#pragma once
 | 
			
		||||
#include_next <errno.h>
 | 
			
		||||
 | 
			
		||||
// Newer versions of picolibc don't seem to provide `__errno_r(r)` in the header file, but is used by ChibiOS.
 | 
			
		||||
#ifndef __errno_r
 | 
			
		||||
#    ifdef __REENT_ERRNO
 | 
			
		||||
#        define __errno_r(r) _REENT_ERRNO(r)
 | 
			
		||||
#    else
 | 
			
		||||
#        define __errno_r(r) (errno)
 | 
			
		||||
#    endif
 | 
			
		||||
#endif
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue