1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-21 18:22:33 +01:00

cpu: Format additions to sse2neon to match the rest of the file

This commit is contained in:
kd-11 2024-09-03 12:50:49 +03:00 committed by kd-11
parent a60eab6e36
commit 7353696014

View File

@ -132,24 +132,26 @@
#include <math.h>
#endif
/* RPCS3 additions */
#if defined(_WIN32)
static inline int posix_memalign(void** memptr, size_t alignment, size_t size) {
static inline int posix_memalign(void** memptr, size_t alignment, size_t size)
{
// Check for valid alignment (must be a power of two and multiple of sizeof(void*))
if (alignment == 0 || (alignment & (alignment - 1)) != 0 || alignment % sizeof(void*) != 0) {
if (alignment == 0 || (alignment & (alignment - 1)) != 0 || alignment % sizeof(void*) != 0)
return EINVAL;
}
// Allocate memory using _aligned_malloc
void* ptr = _aligned_malloc(size, alignment);
if (ptr == NULL) {
if (!ptr)
// NOTE: _aligned_malloc sets errno, ideally we should use that to generate the return code
return ENOMEM;
}
// Set the output pointer
// Success
*memptr = ptr;
return 0; // Success
return 0;
}
#endif
/* End RPCS3 additions */
/* "__has_builtin" can be used to query support for built-in functions
* provided by gcc/clang and other compilers that support it.