mirror of
				https://github.com/nicbarker/clay.git
				synced 2025-11-04 08:36:17 +00:00 
			
		
		
		
	Remove overflow trap from raylib renderer
This commit is contained in:
		
							parent
							
								
									7d73ccd60d
								
							
						
					
					
						commit
						d0694f7144
					
				| 
						 | 
					@ -4,7 +4,9 @@
 | 
				
			||||||
#include "string.h"
 | 
					#include "string.h"
 | 
				
			||||||
#include "stdio.h"
 | 
					#include "stdio.h"
 | 
				
			||||||
#include "stdlib.h"
 | 
					#include "stdlib.h"
 | 
				
			||||||
 | 
					#ifdef CLAY_OVERFLOW_TRAP
 | 
				
			||||||
#include "signal.h"
 | 
					#include "signal.h"
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define CLAY_RECTANGLE_TO_RAYLIB_RECTANGLE(rectangle) (Rectangle) { .x = rectangle.x, .y = rectangle.y, .width = rectangle.width, .height = rectangle.height }
 | 
					#define CLAY_RECTANGLE_TO_RAYLIB_RECTANGLE(rectangle) (Rectangle) { .x = rectangle.x, .y = rectangle.y, .width = rectangle.width, .height = rectangle.height }
 | 
				
			||||||
#define CLAY_COLOR_TO_RAYLIB_COLOR(color) (Color) { .r = (unsigned char)roundf(color.r), .g = (unsigned char)roundf(color.g), .b = (unsigned char)roundf(color.b), .a = (unsigned char)roundf(color.a) }
 | 
					#define CLAY_COLOR_TO_RAYLIB_COLOR(color) (Color) { .r = (unsigned char)roundf(color.r), .g = (unsigned char)roundf(color.g), .b = (unsigned char)roundf(color.b), .a = (unsigned char)roundf(color.a) }
 | 
				
			||||||
| 
						 | 
					@ -226,7 +228,9 @@ void Clay_Raylib_Render(Clay_RenderCommandArray renderCommands)
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            default: {
 | 
					            default: {
 | 
				
			||||||
                printf("Error: unhandled render command.");
 | 
					                printf("Error: unhandled render command.");
 | 
				
			||||||
 | 
					                #ifdef CLAY_OVERFLOW_TRAP
 | 
				
			||||||
                raise(SIGTRAP);
 | 
					                raise(SIGTRAP);
 | 
				
			||||||
 | 
					                #endif
 | 
				
			||||||
                exit(1);
 | 
					                exit(1);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue