[ox/std] Fix problems in building with GCC 12
This commit is contained in:
		
							
								
								
									
										10
									
								
								deps/ox/src/ox/std/algorithm.hpp
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										10
									
								
								deps/ox/src/ox/std/algorithm.hpp
									
									
									
									
										vendored
									
									
								
							| @@ -20,4 +20,14 @@ constexpr It find(It begin, It end, const T &value) { | ||||
| 	return end; | ||||
| } | ||||
|  | ||||
| template<typename It> | ||||
| constexpr It find_if(It begin, It end, auto predicate) { | ||||
| 	for (; begin != end; ++begin) { | ||||
| 		if (predicate(*begin)) { | ||||
| 			return begin; | ||||
| 		} | ||||
| 	} | ||||
| 	return end; | ||||
| } | ||||
|  | ||||
| } | ||||
							
								
								
									
										4
									
								
								deps/ox/src/ox/std/assert.cpp
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								deps/ox/src/ox/std/assert.cpp
									
									
									
									
										vendored
									
									
								
							| @@ -15,7 +15,6 @@ namespace ox { | ||||
|  | ||||
| void panic([[maybe_unused]]const char *file, [[maybe_unused]]int line, [[maybe_unused]]const char *panicMsg, [[maybe_unused]]const Error &err) noexcept { | ||||
| #ifdef OX_USE_STDLIB | ||||
| 	if (!std::is_constant_evaluated()) { | ||||
| 	oxErrf("\033[31;1;1mPANIC:\033[0m [{}:{}]: {}\n", file, line, panicMsg); | ||||
| 	if (err.msg) { | ||||
| 		oxErrf("\tError Message:\t{}\n", err.msg); | ||||
| @@ -27,9 +26,6 @@ void panic([[maybe_unused]]const char *file, [[maybe_unused]]int line, [[maybe_u | ||||
| 	printStackTrace(2); | ||||
| 	oxTrace("panic").del("") << "Panic: " << panicMsg << " (" << file << ":" << line << ")"; | ||||
| 	std::abort(); | ||||
| 	} else { | ||||
| 		assert(false); | ||||
| 	} | ||||
| #endif | ||||
| } | ||||
|  | ||||
|   | ||||
							
								
								
									
										11
									
								
								deps/ox/src/ox/std/strops.cpp
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										11
									
								
								deps/ox/src/ox/std/strops.cpp
									
									
									
									
										vendored
									
									
								
							| @@ -28,3 +28,14 @@ static_assert([] { | ||||
| 	retval |= !(ox_lastIndexOf(testStr, 'a', ox_strlen(testStr)) == 3); | ||||
| 	return retval == 0; | ||||
| }(), "ox_lastIndexOf aaaa a"); | ||||
|  | ||||
| #ifndef OX_USE_STDLIB | ||||
|  | ||||
| extern "C" | ||||
| std::size_t strlen(const char *str) { | ||||
| 	std::size_t len = 0; | ||||
| 	for (; str[len]; len++); | ||||
| 	return len; | ||||
| } | ||||
|  | ||||
| #endif | ||||
|   | ||||
							
								
								
									
										1
									
								
								deps/ox/src/ox/std/vector.hpp
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								deps/ox/src/ox/std/vector.hpp
									
									
									
									
										vendored
									
									
								
							| @@ -9,6 +9,7 @@ | ||||
| #pragma once | ||||
|  | ||||
| #include "bit.hpp" | ||||
| #include "error.hpp" | ||||
| #include "initializerlist.hpp" | ||||
| #include "iterator.hpp" | ||||
| #include "math.hpp" | ||||
|   | ||||
		Reference in New Issue
	
	Block a user